AsNoTracking as an option for the GetObjects Methods in SqlDatabaseService.cs

Our testers found a bug in which when they have two tabs open and they edit the same object it was not returning the latest values for the object.

I understand that GetObjectById uses AsNoTracking to ensure it pulls the latest object info, but I am using GetObjects with a query because I need to Expand upon the object. I filter by Id and then use Expand for what I need.

My solution for now is in the picture above, adding an optional asNoTracking flag.

Is this something to consider for the auto scaffolding script so it can be there to be taken advantage of as needed?

Was there a reason it was decided to use AsNoTracking for GetObjectById but not GetObjects methods?

Hi @Chad,

You can turn off tracking globally:

1 Like