EF4 (CPT5) ForeignKeyAttribute in base class - Assert Failure entityType != null
- by Anthony Johnston
Getting an error when trying to set a ForeignKeyAttribute in a base class
class User{}
abstract class FruitBase{
[ForeignKey("CreateById")]
public User CreateBy{ get; set; }
public int CreateById{ get; set; }
}
class Banana{}
class DataContext : DbContext{
DbSet<Banana> Bananas{ get; set; }
}
If I move the FruitBase code into the banana, all is well, but I don't want to, as there will be many many fruit and I want to remain relatively DRY if I can
Is this a know issue that will be fixed by March?
Does anyone know a work around?