I want to use an abstract base class for entities, which is not mapped on any table:
public abstract class Entity
{
public virtual int Id { get; private
EF likes to access all keys. Try using protected so the assembly can access the ID but externals cant. Seems like a reasonable question for the EF team to me.
See related post Does the Entity Framework code first support readonly navigation property
make setter of id in entity class protected :
public abstract class Entity
{
public virtual int Id { get; protected set; }
}
i tried this . it will be work