Entity Framework Core

Many to many

Many-to-many

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
public class Post
{
public int PostId { get; set; }
public string Title { get; set; }
public string Content { get; set; }

public ICollection<Tag> Tags { get; set; }
}

public class Tag
{
public string 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 (
CtrlP
) instead.