开发者

Applying data annotation on entity framework auto generated file

开发者 https://www.devze.com 2022-12-28 20:33 出处:网络
I have generated entity framework designer classes . After Ge开发者_如何转开发nerating the designer what is the most nicest and cleanest way to apply data annotation to the properties there . I have 3

I have generated entity framework designer classes . After Ge开发者_如何转开发nerating the designer what is the most nicest and cleanest way to apply data annotation to the properties there . I have 3 classes there


Open up the EF designer, click on whatever you want to give documentation to, and fill in the "Documentation" field in the properties tab.

Ah, you are talking about attributes, not annotations. See this stackoverflow post.

In short - you can't do it. If you absolutely need attributes, you'll have to write your own Entity classes (POCO), which is only supported in the new version of Entity Framework (in .Net 4.0)

0

精彩评论

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