c# - Add DataAnnotations to entity class using database first approach -


i'm trying migrate large (+100000 loc) wpf application telerik data access entity framework 6.1.3.

i'm new entity framework , wondering how generate data annotations poco's.

adding them manually not option because have few hundred views many columns.

the data annotations not important data validation excel export functionally. entity framework maps both date , datetime2 (sql server) datetime (c#). excel export method uses data annotations pick correct cell format (eg. 2016-06-27 instead of 2016-06-15 00:00:00.000)

the desired result should this:

private datetime? _transactiondate; [system.componentmodel.dataannotations.datatype(system.componentmodel.dataannotations.datatype.date)] public virtual datetime? transactiondate {         {         return this._transactiondate;     }     set     {         this._transactiondate = value;     } } 

questions: how can enabled dataannotations in entity framework 6.1.3

try taking @ ef power tools part of way there. rest think going have manually.


Comments