I have the following two tables
public class Book
{
public int Id { get; set; }
[Required]
[StringLength(255)]
public string BookTitle { get; set; }
[Required]
[StringLength(255)]
public string Author { get; set; }
[Required]
[StringLength(400)]
public string Description { get; set; }
}
and,
public class Rating
{
public int Id { get; set; }
[Required]
public int Rate { get; set; }
public Book Books { get; set; }
[Required]
public int BookId { get; set; }
}
one Book can have many Ratings. I need to write a Query so that i can view the BookTitle, Author, Description and the Average Rating for each book. I know I can use a View Model but I dont know how to structure the LINQ Query
and help would be appreciated