Skip to content

Commit

Permalink
Added AsNoTracking on the db fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
knuhau committed Jan 6, 2025
1 parent ae445bb commit 3f71d19
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ await _subjectResourcesCache.GetOrSetAsync(nameof(SubjectResource), async ct =>
{
using var scope = _serviceScopeFactory.CreateScope();
var dbContext = scope.ServiceProvider.GetRequiredService<DialogDbContext>();
return await dbContext.SubjectResources.ToListAsync(cancellationToken: ct);
return await dbContext.SubjectResources.AsNoTracking().ToListAsync(cancellationToken: ct);
},
token: cancellationToken);

Expand Down

0 comments on commit 3f71d19

Please sign in to comment.