I have generated entity framework designer classes . After Generating the designer what is the most nicest and cleanest way to apply data annotation to the properties there . I have 3 classes there
Asked
Active
Viewed 2,048 times
1
-
1This post shows how to do it. http://stackoverflow.com/questions/4915957/using-system-componentmodel-dataannotations-with-entity-framework-4-0/ – John Mar 30 '11 at 15:30
1 Answers
0
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)

Community
- 1
- 1

BlueRaja - Danny Pflughoeft
- 84,206
- 33
- 197
- 283
-
Well can I write this in documentation [Required(ErrorMessage="Please Enter The GroupName")]? If not then where can i write these – maztt Apr 29 '10 at 18:22
-
I am entering this [Required(ErrorMessage="Please Enter The GroupName")] in the docomentation but it is coming in the file with the comments tag // – maztt Apr 29 '10 at 18:25