I am using EntityFramework code first. Lets say this is my classes:
public abstract class BlockModel
{
public int Id { get; set; }
}
public class ModuleBlockModel : BlockModel
{
}
public abstract class BlockModelParameter
{
public int Id { get; set; }
public virtual BlockModel BlockModel { get; set; }
}
public class ModuleBlockModelParameter : BlockModelParameter
{
public new virtual ModuleBlockModel BlockModel { get; set; }
}
and my DbContext class:
public IDbSet<ModuleBlockModel> BlockModels { get; set; }
public IDbSet<ModuleBlockModelParameter> BlockModelParameters { get; set;}
when i try to get items, EF creating another property same name. One is null and other is correct.
and try to get BlockModel value throws null value.
Is there an EF bug? How can get BlockModel property correctly.
Thanks.