run-aspnetcore icon indicating copy to clipboard operation
run-aspnetcore copied to clipboard

How to create lookup entites that inherit differently than data entites ?

Open punkouter2021 opened this issue 5 years ago • 0 comments

So I have Normal entity which always includes

public abstract class Entity : EntityBase { public DateTime CreatedOn { get; set; }

    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'.

punkouter2021 avatar Aug 22 '19 16:08 punkouter2021