Many-to-many relationships require a collection navigation property on both sides. They will be discovered by convention like other types of relationships.
C#Copy
publicclassPost
{
publicint PostId { get; set; }
publicstring Title { get; set; }
publicstring Content { get; set; }
public ICollection<Tag> Tags { get; set; }
}
publicclassTag
{
publicstring TagId { get; set; }
public ICollection<Post> Posts { get; set; }
}
Want to print your doc? This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (