I have an object Loan that contains a property object called Book.
class Loan {
Book book;
string user;
}
public class Book
{
public int BookId { get; set; }
public int AuthId { get; set; }
public int BookDetailsId { get; set; }
public string title { get; set; }
public Nullable<int> BookCopies { get; set; }
public virtual Auhtor Auhtor { get; set;
public virtual BookDetail BookDetail { get; set; }
}
Then I have a List<Loan> allLoans
and I want to find which book appears the most in that list (which is the most frequent one?).
How could I do that?