Tutorial by Examples

By default, queries that return entity types are tracking This means you can make changes to those entity instances and have those changes persisted by SaveChanges() Example : The change to the book rating will be detected and persisted to the database during SaveChanges(). using (va...
No tracking queries are useful when the results are used in a read-only scenario They are quicker to execute because there is no need to setup change tracking information Example : using (var context = new BookContext()) { var books = context.Books.AsNoTracking().ToList(); } With ...
Even if the result type of the query isn’t an entity type, if the result contains entity types they will still be tracked by default Example : In the following query, which returns an anonymous type, the instances of Book in the result set will be tracked using (var context = new BookC...

Page 1 of 1