You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I send several queries with similar arguments yet different asOf timestamps using a single instance of DbContext, I always get similar results, apparently because of tracking. I solve this issue in my code by adding AsNoTracking():
public static IQueryable<TSource> AsOfConditional<TSource>(this IQueryable<TSource> source, DateTime? asOf)
where TSource : class
{
if (asOf.HasValue)
return source.AsOf(asOf.Value).AsNoTracking();
return source;
}
This may be not the responsibility of this library, but it might be helpful to extend AsOf() or at least give users some hints.
The text was updated successfully, but these errors were encountered:
When I send several queries with similar arguments yet different asOf timestamps using a single instance of DbContext, I always get similar results, apparently because of tracking. I solve this issue in my code by adding AsNoTracking():
This may be not the responsibility of this library, but it might be helpful to extend AsOf() or at least give users some hints.
The text was updated successfully, but these errors were encountered: