-
-
Save christiannagel/ee93d99e18bc444a3b48e5c381088c93 to your computer and use it in GitHub Desktop.
Book class to use lazy loading with EF Core
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Book | |
{ | |
public Book(int bookId, string title) => (BookId, Title) = (bookId, title); | |
public int BookId { get; set; } | |
public string Title { get; set; } | |
public virtual ICollection<Chapter> Chapters { get; } = new List<Chapter>(); | |
public int? AuthorId { get; set; } | |
public int? ReviewerId { get; set; } | |
public int? EditorId { get; set; } | |
public virtual User? Author { get; set; } | |
public virtual User? Reviewer { get; set; } | |
public virtual User? Editor { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment