Есть два класса Author
и Book
public class Book
{
public int BookId { get; set; }
public string View { get; set; }
public string Name { get; set; }
public DateTime PublishedDate { get; set; }
public string Publisher { get; set; }
public bool InStock { get; set; }
public double Price { get; set; }
public decimal Discont { get; set; }
public int? AuthorId { get; set; }
public Author Author { get; set; }
}
public class Author
{
public int AuthorId { get; set; }
public string Name { get; set; }
public List<Book> Books{ get; set; }
}
public DbSet<Book> Books { get; set; }
public DbSet<Author> Authors { get; set; }
Если я в коде напишу
var auth = db.Authors.ToList();
То система не показывает мне книги автора