Entity Framework Reverse Engineer using Power Tools - No Primary Keys

*爱你&永不变心* 提交于 2019-12-12 05:17:18

问题


I've used the Entity Framework Power Tools Beta 2 to reverse engineer my model classes. However no primary keys have been declared in the data annotations. Is there a way to do this?


回答1:


By default, the mapping done via fluent.

If you want to change that, you can customize the TT files used to generate the model. Where you would remove it from the mapping.tt and then add the data annotation to entity.tt. Rowan Miller made a great post about that.



来源:https://stackoverflow.com/questions/12110569/entity-framework-reverse-engineer-using-power-tools-no-primary-keys

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!