...
首页> 外文期刊>Visual Studio Magazine >Code First is a new development approach in the Entity Framework development stack. It enables the development of EDMs using only code and without the need for static .edmx files.
【24h】

Code First is a new development approach in the Entity Framework development stack. It enables the development of EDMs using only code and without the need for static .edmx files.

机译:Code First是Entity Framework开发堆栈中的一种新开发方法。它使仅使用代码即可开发EDM,而无需使用静态.edmx文件。

获取原文
获取原文并翻译 | 示例
           

摘要

The EmployeeTypeConfiguration holds the same configuration that existed in the OnModelCreating method. The only difference is that you don't use the DbModelBuilder and its Entity generic method. The configurations are being done in the constructor of the configuration class. To wire the configuration to the DbModelBuilder, you'll have to use the Add method of the DbModelBuilder Configuration collection. The following line of code will do exactly that: Dbmodel Builder.Configurations.Add(new EmployeeTypeConfigurationo); Another configuration method in Code First is the use of the data annotations assembly. Data Annotations and Code First Integration Data annotations aren't a new concept. The System.Component Model.DataAnnotations assembly is being widely used in a lot of frameworks such as ASP.NET MVC, Dynamic Data, WCF RIA Services and more. The data annotations are attributes that decorate properties and classes. They offer the ability to put cross-cutting concerns like validations outside the scope of the domain model and to decorate the model in order to impose these concerns.
机译:EmployeeTypeConfiguration保留与OnModelCreating方法中存在的相同配置。唯一的区别是您不使用DbModelBuilder及其实体通用方法。配置是在配置类的构造函数中完成的。要将配置连接到DbModelBuilder,您必须使用DbModelBuilder Configuration集合的Add方法。下面的代码行将完全做到这一点:Dbmodel Builder.Configurations.Add(new EmployeeTypeConfigurationo); Code First中的另一种配置方法是使用数据注释程序集。数据注释和代码优先集成数据注释不是一个新概念。 System.Component Model.DataAnnotations程序集被广泛用于许多框架中,例如ASP.NET MVC,动态数据,WCF RIA服务等。数据批注是装饰属性和类的属性。它们提供了将诸如验证之类的跨领域关注点置于域模型范围之外的能力,并可以修饰模型以强加这些关注点。

著录项

  • 来源
    《Visual Studio Magazine》 |2011年第5期|p.28|共1页
  • 作者

  • 作者单位
  • 收录信息
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类
  • 关键词

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号