API

EF Core AsNoTracking

Returns entities without attaching them to the normal context change tracker.

Formal Syntax & Structure

csharp syntaxcsharp
ctx.Books.AsNoTracking().Single(b => b.Id == 1)

Working Example

Example Snippetcsharp
// Documentary fragment; see linked lesson for context.ctx.Books.AsNoTracking().Single(b => b.Id == 1)
C# & .NET Reference