A navigation property is an ORM-mapped object or collection property that traverses a relationship to related entities. In Entity Framework Core, navigation properties help represent relationships and perform joins; they can be optional when a related entity is not required. section 5.2.3
Model relationships through corresponding entity properties:
- Use an object property for a one-to-one relationship, such as Book.Rating and Rating.Book. section 5.2.3
- Use a collection property for one-to-many relationships, such as Book.Ratings, which EF Core recognizes by convention. section 5.2.3
- Use collections on both entities for many-to-many relationships, such as Book.Tags and Tag.Books. section 5.2.3
Loading related ratings
Query books with dbContext.Books.Include(b => b.Ratings), then iterate through each book’s Ratings collection to display star ratings and comments. section 5.2.3
Listing 5.8 One-to-one relationship with Book as the parent and Rating as the child
class Book {
public int Id {get;set;}
public Rating? Rating {get;}
}
class Rating
{
public int Id {get;set;}
public int BookId {get;set;}
public Book Book {get;set}
}
Inspect the paired Book and Rating properties, including the optional navigation and the BookId foreign key used by convention. section 5.2.3


