Skip to content

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

Open
@punkouter2021

Description

@punkouter2021

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();
}
……

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'. There is no implicit reference conversion from 'Pwdx.Core.Entities.RfCategory' to 'Pwdx.Core.Entities.Base.Entity'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions