ExecuteQuery<Entity> result is tracked?

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
-marcelo-
Posts: 26
Joined: Wed 28 Jun 2017 12:35

ExecuteQuery<Entity> result is tracked?

Post by -marcelo- » Sat 13 Oct 2018 18:00

I would like to know if the results of following query will be tracked by the context.

Code: Select all

// argument is of type Clerk, database table is clerk
query = "SELECT * from clerk where id = {0}";
List<Clerk> result = context.ExecuteQuery<Clerk>(query, new object[] { argument.Id } ).ToList<Clerk>();
I would need that it´s not tracked. I´m simply reading again from database a record which is already contained in context´s Table<Clerk> Clerks member.

TIA

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: ExecuteQuery<Entity> result is tracked?

Post by Shalex » Thu 18 Oct 2018 12:40

It will be tracked by default. If you want to turn tracking off, please set context.EntityCachingMode=EntityCachingMode.None.

Post Reply