A many-to-many relationship lets multiple books have multiple tags, and multiple tags apply to multiple books. In EF Core, collection properties on both entities describe the relationship; EF Core creates a join table with a compound primary key made from both entity IDs and foreign keys to each table. section 5.2.3
Listing 5.10 Many-to-many relationship between Book and Tag
class Book {
public int Id {get;set;}
public List<Tag> Tags {get;}
}
class Tag
{
public int Id {get;set;}
public List<Book> Books {get;}
}
The Book and Tag collection properties show how to represent the relationship in C#. section 5.2.3




