I have created a class library project in VS2010 ultimate with .net 4.0 and Entity fwk-4.1.
After adding a ref to the Entity framework dll, I am not able to use the Data Annotation attributes like 'Required' on class properties.
Could you please let me know what is the solution?
Requiredattribute is defined insideSystem.ComponentModel.DataAnnotationsnamespace and is available inSystem.ComponentModel.DataAnnotationsassembly(dll)1) Make sure to add a reference to
System.ComponentModel.DataAnnotationsassembly(dll)2) Add a using statement to import the
System.ComponentModel.DataAnnotationsnamespace in your class file.