Framework Queryable Extensions. As NoTracking With Identity Resolution<TEntity>(IQueryable<TEntity>) Method
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The change tracker will not track any of the entities that are returned from a LINQ query. If the entity instances are modified, this will not be detected by the change tracker and SaveChanges() will not persist those changes to the database.
Disabling change tracking is useful for read-only scenarios because it avoids the overhead of setting up change tracking for each entity instance. You should not disable change tracking if you want to manipulate entity instances and persist those changes to the database using SaveChanges().
Identity resolution will be performed to ensure that all occurrences of an entity with a given key in the result set are represented by the same entity instance.
The default tracking behavior for queries can be controlled by QueryTrackingBehavior.
public static System.Linq.IQueryable<TEntity> AsNoTrackingWithIdentityResolution<TEntity> (this System.Linq.IQueryable<TEntity> source) where TEntity : class;
static member AsNoTrackingWithIdentityResolution : System.Linq.IQueryable<'Entity (requires 'Entity : null)> -> System.Linq.IQueryable<'Entity (requires 'Entity : null)> (requires 'Entity : null)
<Extension()> Public Function AsNoTrackingWithIdentityResolution(Of TEntity As Class) (source As IQueryable(Of TEntity)) As IQueryable(Of TEntity)
The type of entity being queried.
The source query.
A new query where the result set will not be tracked by the context.