Implementing a Base Class with Entity Framework

I want to add a bunch of audit fields to all of my tables.  Here's how I did it with a base class.  Note that the base class must have a key column. The subclass does not have an ID explicitly; it inherits the ID column from the base class.

The call to MapInheritedProperties will put the inherited properties directly on the subclass table. 



Comments

Popular Posts