I am working with a legacy database that has a table to store up to 5 categories a user has permissions to view:
USER_ELIGIBILITY
----------------
Eligibility_Id INT PRIMARY KEY
Eligibility_Name NVARCHAR(100)
CategoryId1 INT
CategoryId2 INT
CategoryId3 INT
CategoryId4 INT
CategoryId5 INT
The following is how I have created the class:
public Eligibility : Entity
{
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual IList<Category> AllowedCategories { get; set; }
}
Is this the right way to model this? If so, how can I map it?