I use EF6 and these are my POCO's.
public class Author
{
public int Id { get; set; }
public string Name { get; set; }
}
public class Book
{
public int Id { get; set; }
[Required]
public string Title { get; set; }
public int Year { get; set; }
public decimal Price { get; set; }
public string Genre { get; set; }
// Foreign Key
public int AuthorId { get; set; }
// Navigation property
public Author Author { get; set; }
}
- What is the point of the navigation property
Author
? - What is the point of making the property
virtual
? - Are navigation properties specific to Entity Framework?
EDIT: after a bit more research I've found this thread, which nicely answer my first question.
Can people help with the last two questions please?