Quantcast
Channel: EntityFramework Reverse POCO Code First Generator
Viewing all articles
Browse latest Browse all 1642

New Post: Adding a metadata attribute?

$
0
0
The generator is setup so you can add whatever attribute you need to your classes. See WritePocoClassAttributes.

For example:
AdditionalNamespaces = new[] { "System", "System.ComponentModel.DataAnnotations" };
Action<Table> WritePocoClassAttributes = t =>
{
    WriteLine("    [MetadataType(typeof(" + t.ClassName + "Metadata))]");
};
You would then have to add the <class>Metadata classes to your project separately.

Viewing all articles
Browse latest Browse all 1642

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>