There is such a model:
public class Genre : DbObject { public string GenreName { get; set; } public virtual ICollection<Book> Books { get; set; } = new List<Book>(); public virtual int BooksCount => Books.Count; } As far as I understand, every time you access BooksCount will be prompted to the database to calculate the number of objects in the Books collection. Can there be any approach so that the BooksCount property BooksCount overwritten only at the moment of changing the collection or are there any other ways to improve this approach?