Skip to content

Commit

Permalink
fix: fixed related repos used by tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ericbrunner committed Dec 18, 2024
1 parent 4f35ca7 commit 4c08578
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ namespace Backbone.Modules.Devices.Infrastructure.Persistence.Repository;

public class IdentitiesRepository : IIdentitiesRepository
{
private readonly DbSet<Identity> _identities;
private readonly IQueryable<Identity> _readonlyIdentities;
private readonly DevicesDbContext _dbContext;
private readonly DbSet<Device> _devices;
private readonly IQueryable<Device> _readonlyDevices;
private readonly UserManager<ApplicationUser> _userManager;
private readonly DbSet<Identity> _identities;
private readonly DbSet<IdentityDeletionProcessAuditLogEntry> _identityDeletionProcessAuditLogs;
private readonly IQueryable<Device> _readonlyDevices;
private readonly IQueryable<Identity> _readonlyIdentities;
private readonly IQueryable<IdentityDeletionProcessAuditLogEntry> _readonlyIdentityDeletionProcessAuditLogs;
private readonly UserManager<ApplicationUser> _userManager;

public IdentitiesRepository(DevicesDbContext dbContext, UserManager<ApplicationUser> userManager)
{
Expand Down Expand Up @@ -173,6 +173,7 @@ public async Task<IEnumerable<Identity>> Find(Expression<Func<Identity, bool>> f
{
return await (track ? _identities : _readonlyIdentities)
.IncludeAll(_dbContext)
.AsSplitQuery()
.Where(filter)
.ToListAsync(cancellationToken);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ namespace Backbone.Modules.Messages.Infrastructure.Persistence.Database.Reposito

public class MessagesRepository : IMessagesRepository
{
private readonly MessagesDbContext _dbContext;
private readonly DbSet<Message> _messages;
private readonly IQueryable<Message> _readOnlyMessages;
private readonly MessagesDbContext _dbContext;

public MessagesRepository(MessagesDbContext dbContext)
{
Expand Down Expand Up @@ -80,7 +80,9 @@ public async Task Update(Message message)

public async Task<IEnumerable<Message>> Find(Expression<Func<Message, bool>> expression, CancellationToken cancellationToken)
{
return await _messages.IncludeAll(_dbContext)
return await _messages
.IncludeAll(_dbContext)
.AsSplitQuery()
.Where(expression)
.ToListAsync(cancellationToken);
}
Expand Down

0 comments on commit 4c08578

Please sign in to comment.