How to set entity framework 4.5 to never set any property as Nullable

▼魔方 西西 提交于 2020-01-05 03:31:41

问题


The one feature that I cannot stand with-in the Entity framework is where the complex Result object sets some properties as Nullable.

Is there a global setting to where that Nullable property is never set to yes?


回答1:


It appears that even if you get the property Nullable to be False, that it will still generate a Nullable version of your object.

Check out the accepted answer of Entity Framework: Set nullable to false, but type is still nullable.

Also, read How to manually update your Entity Framework model classes when they get out of sync with your database for a description of how to use the Run Custom Tool option to run a T4 template after your model has been generated.



来源:https://stackoverflow.com/questions/18434409/how-to-set-entity-framework-4-5-to-never-set-any-property-as-nullable

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