上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 46 下一页
摘要: 原文:http://www.entityframeworktutorial.net/code-first/code-based-migration-in-code-first.aspx 当你想在迁移中有更多的操作,比如设置列的默认值等时,基于代码的迁移就非常有用了。 Code-First有两个基于代 阅读全文
posted @ 2017-08-09 10:49 talentzemin 阅读(330) 评论(0) 推荐(0)
摘要: 原文:http://www.entityframeworktutorial.net/code-first/automated-migration-in-code-first.aspx EF4.3引入了自动迁移,因此你不必在代码文件中手动处理数据库迁移。对于你在域类中进行的每次更改, 只需要在Pack 阅读全文
posted @ 2017-08-09 10:28 talentzemin 阅读(303) 评论(0) 推荐(0)
摘要: 原文:http://www.entityframeworktutorial.net/code-first/migration-in-code-first.aspx EF Code-First在EF 4.3之前有不同的数据库初始化策略,如CreateDatabaseIfNotExists,DropCr 阅读全文
posted @ 2017-08-09 10:18 talentzemin 阅读(157) 评论(0) 推荐(0)
摘要: 原文:http://www.entityframeworktutorial.net/code-first/seed-database-in-code-first.aspx 你可以在数据库初始化过程中将数据插入到数据库表中。 如果要为应用程序提供一些测试数据或为应用程序提供一些默认的主数据的话,这将非 阅读全文
posted @ 2017-08-09 10:13 talentzemin 阅读(488) 评论(0) 推荐(0)
摘要: 原文:http://www.entityframeworktutorial.net/code-first/turn-off-database-initialization-in-code-first.aspx 你也可以关闭应用程序的DB初始化程序。 假设,对于生产环境,你不想丢失现有数据,那么可以关 阅读全文
posted @ 2017-08-08 17:31 talentzemin 阅读(232) 评论(0) 推荐(0)
摘要: 原文:http://www.entityframeworktutorial.net/code-first/database-initialization-strategy-in-code-first.aspx 在第一次运行Code-First应用程序后已经创建了一个数据库,但是第二次启动时呢?每次运 阅读全文
posted @ 2017-08-08 17:28 talentzemin 阅读(300) 评论(0) 推荐(0)
摘要: 原文:http://www.entityframeworktutorial.net/code-first/move-configurations-to-seperate-class-in-code-first.aspx 到目前为止,我们已经在前面的章节中配置了OnModelCreating方法中的所 阅读全文
posted @ 2017-08-08 17:06 talentzemin 阅读(258) 评论(0) 推荐(0)
摘要: 原文:http://www.entityframeworktutorial.net/code-first/cascade-delete-in-code-first.aspx 当删除主记录时,级联删除会自动删除相关记录,或将外键属性设置为空值。 默认情况下,EF对所有类型的关系(一对一、一对多和多对多 阅读全文
posted @ 2017-08-07 16:00 talentzemin 阅读(265) 评论(0) 推荐(0)
摘要: 原文:http://www.entityframeworktutorial.net/code-first/code-first-from-existing-database.aspx 本节,将学习如何为现有数据库生成Code First上下文和实体类。 EF为现有数据库使用Code First方法提 阅读全文
posted @ 2017-08-07 15:38 talentzemin 阅读(187) 评论(0) 推荐(0)
摘要: 原文:http://www.entityframeworktutorial.net/code-first/configure-many-to-many-relationship-in-code-first.aspx 本节,我们将学习如何配置Student 和Course 实体类之间的多对多关系。St 阅读全文
posted @ 2017-08-04 15:15 talentzemin 阅读(203) 评论(0) 推荐(0)
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 46 下一页