Page 1 of 1

ExecuteQuery<Entity> result is tracked?

Posted: Sat 13 Oct 2018 18:00
by -marcelo-
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

Re: ExecuteQuery<Entity> result is tracked?

Posted: Thu 18 Oct 2018 12:40
by Shalex
It will be tracked by default. If you want to turn tracking off, please set context.EntityCachingMode=EntityCachingMode.None.