-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels