This exact question has been asked (5 years ago), but the answer there doesn't compile. So I'm asking again.
I have a class that is a set of skills, similar to the tags in a SO question, where users are assigned a number of skills. The skills table has a row for each skill and will be static (occasionally an additional skill may be added).
Each user is assigned a collection of 0..N skills. And there are 2 collections, the self-certified skills and the passing a test certified skills.
The user class includes:
public class User
{
public ICollection<Skill> SelfIdentifiedSkills { get; set; }
public ICollection<Skill> CertifiedSkills { get; set; }
// ...
}
And the skill class is:
public class Skill
{
public int Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
What do I need to add to OnModelCreating()
to make this work? Both for handling the fact that the Skill
records are static and to handle that both collections are a collection against the same table and so I need to avoid naming collisions.