【发布时间】:2015-02-21 12:54:46
【问题描述】:
我启动了一个示例实体框架项目。我有 EntityModel.edmx 文件,当我单击 EntityModel.Designer.cs 文件时,它会打开一个写入的文件:
// T4 code generation is enabled for model 'c:\users\scala\documents\visual studio 2013\Projects\entityFramework\entityFramework\EntityModel.edmx'.
// To enable legacy code generation, change the value of the 'Code Generation Strategy' designer
// property to 'Legacy ObjectContext'. This property is available in the Properties Window when the model
// is open in the designer.
// If no context and entity classes have been generated, it may be because you created an empty model but
// have not yet chosen which version of Entity Framework to use. To generate a context class and entity
// classes for your model, open the model in the designer, right-click on the designer surface, and
// select 'Update Model from Database...', 'Generate Database from Model...', or 'Add Code Generation
// Item...'.
我无法获取实体代码。如何获取实体代码?我无法更改“代码生成策略”设计器 属性窗口中的“旧版 ObjectContext”。
【问题讨论】:
-
我建议你先使用代码而不是先使用数据库来进行完全控制