开发者

Entity Framework - Specify Template when Generating Model

When I'm generating/refreshing my model from the database, how do I specify which template to use?

At the moment, despite having my new template, it still uses the default. Then I have to开发者_JAVA技巧 go in and clear out the contents of 'MyDatabase.Designer.cs', then manually go in to my template and run it.

Surely I can just specify which template my model should use?


At first, you should disable the default code generation. The simplest solution is to clear the Custom Tool property of the model file.
After this just run your template.
There is even simpler way: go to the model Properties and set the Code Generation Strategy property to None.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜