Based on other messages, such as Entity Framework and DbContext - object tracking, it would seem that the simplified DBContext interface does not provide No tracking for basic queries. A small blog showing how with the object context http://blogs.microsoft.co.il/blogs/gilf/archive/2009/02/20/disabling-change-tracking-in-entity-framework.aspx
What good approach to loading results through DbContext is not monitored? How does conscious performance do this when using Dbcontext? those. have a basic GetList method that I would like to improve for performance reasons.
public DbSet<T> EntityDbSet { get { return _context.Set<T>(); } } public virtual IQueryable<T> GetList(Expression<Func<T, bool>> predicate) { return EntityDbSet.Where(predicate); }
AsNoTracking is an extension of IQueryable.
You can update your function above:
public virtual IQueryable<T> GetList(Expression<Func<T, bool>> predicate) { return EntityDbSet.Where(predicate).AsNoTracking(); }
Source: https://habr.com/ru/post/1440104/More articles:Split into all monkeys with a comma - javascriptDesign pattern for truncating a graph of a large object - javaRecursion - two calls in one statement - methodsIf the file is read before epoll_ctl is called in edge mode, will epoll_wait return immediately? - linuxGrain Value in OOP - oopWhat is the correct form declaration in VB.NET? - vb.netConvert SVGs to create perspective ("keystone") - svgHow to use MS CRM 2011 web services in iOS? - iosEntity Framework and DbContext - object tracking - c #Search for a position in Lucene 4 - javaAll Articles