I am trying to do something like this :
public class TrackerContext : DbContext
{
public bool TrackNewValues { get; set; }
public TrackerContext(boo
I have been using generic classes with success in Entity Framework. If you declare your class and DbSet the following way it will work.
public class AuditLogString : AuditLog<String>{}
public DbSet<AuditLogString> AuditLogStrings { get;set;}
[Update] I have not used this method recently and in the light of the comments on this answer I suggest Pawel's answer instead. However I have not deleted this answer since I was able to use the method.
You cannot map the generic type because Entity Framework simply doesn't support generic Entity types. When using the EF Code-First approach you need to remember that you should model your POCO classes within the constraints that allow Entity Framework to create POCO proxies.
This means, shortly speaking that such a class: