Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
AsNoTracking(T) Method (IQueryable(T))
Collapse the table of content
Expand the table of content

DbExtensions.AsNoTracking<T> Method (IQueryable<T>)

Entity Framework 5.0

Returns a new query where the entities returned will not be cached in the DbContext or ObjectContext.

Namespace:  System.Data.Entity
Assembly:  EntityFramework (in EntityFramework.dll)

public static IQueryable<T> AsNoTracking<T>(
	this IQueryable<T> source
)
where T : class

Type Parameters

T

The element type.

Parameters

source
Type: System.Linq.IQueryable<T>

The source query.

Return Value

Type: System.Linq.IQueryable<T>
A new query with NoTracking applied, or the source query if NoTracking is not supported.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IQueryable<T>. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.103).aspx or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.103).aspx.

This method works by calling the AsNoTracking method of the underlying query object. If the underlying query object does not have a AsNoTracking method, then calling this method will do nothing.

Show:
© 2015 Microsoft