run-aspnetcore
run-aspnetcore copied to clipboard
How to create lookup entites that inherit differently than data entites ?
So I have Normal entity which always includes
public abstract class Entity : EntityBase
public string CreatedBy { get; set; }
}
And then for lookup tables I do not want these so I created another..
public abstract class EntityLookup : EntityBase
}
And for the entity I say..
public class RfCategory : EntityLookup { public RfCategory() { RfReports = new HashSet<RfReport>(); } ……
But it says this.. Any idea why ? Or am I going about this the wrong way? The main idea is I want entities to inherit differently depending on the type of table..
1>Repositories\IRfCategoryRepository.cs(10,22,10,43): error CS0311: The type 'Pwdx.Core.Entities.RfCategory' cannot be used as type parameter 'T' in the generic type or method 'IRepository<T>'. There is no implicit reference conversion from 'Pwdx.Core.Entities.RfCategory' to 'Pwdx.Core.Entities.Base.Entity'.