Search code examples
entity-frameworkef-code-firstef-power-tools

How can I get EF Power Tools to add StringLength when reverse engineering?


How can I get EF Power Tools to add the Data Annotation Attribute StringLength when reverse engineering an existing database into a Code First model?


Solution

  • Yes.You can do that.If you look in the mapping classes (those are the ones in the Mapping folder) you’ll see that ‘Reverse Engineer Code First’ uses the Fluent API for all it’s configuration.If you need to do these things by using DataAnnotation, Please follow the below mentioned article for step by step guide.

    Customizing ‘Reverse Engineer Code First’ In The EF Power Tools