QueryableExtensions.AsNoTracking Method (IQueryable)

[This page is specific to the Entity Framework version 6. The latest version is available as the 'Entity Framework' NuGet package. For more information about Entity Framework, see msdn.com/data/ef.]

Returns a new query where the entities returned will not be cached in the DbContext or ObjectContext. This method works by calling the AsNoTracking method of the underlying query object. If the underlying query object does not have an AsNoTracking method, then calling this method will have no affect.

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function AsNoTracking ( _
    source As IQueryable _
) As IQueryable
'Usage
Dim source As IQueryable 
Dim returnValue As IQueryable 

returnValue = source.AsNoTracking()
public static IQueryable AsNoTracking(
    this IQueryable source
)
[ExtensionAttribute]
public:
static IQueryable^ AsNoTracking(
    IQueryable^ source
)
static member AsNoTracking : 
        source:IQueryable -> IQueryable
public static function AsNoTracking(
    source : IQueryable
) : IQueryable

Parameters

Return Value

Type: System.Linq.IQueryable
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. 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.113) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.113).

See Also

Reference

QueryableExtensions Class

AsNoTracking Overload

System.Data.Entity Namespace