1
0
mirror of https://github.com/bitwarden/server synced 2025-12-16 00:03:54 +00:00

[AC-432] Changed ProviderOrganization_ReadByOrganizationIds to only get count

This commit is contained in:
Rui Tome
2023-04-06 15:24:05 +01:00
parent 735775e002
commit 4daebe4f47
8 changed files with 36 additions and 21 deletions

View File

@@ -68,15 +68,9 @@ public class ProviderOrganizationRepository :
}
}
public async Task<IEnumerable<ProviderOrganization>> GetManyByOrganizationIdsAsync(IEnumerable<Guid> organizationIds)
public async Task<int> GetCountByOrganizationIdsAsync(IEnumerable<Guid> organizationIds)
{
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var query = from po in dbContext.ProviderOrganizations
where organizationIds.Contains(po.OrganizationId)
select po;
return await query.ToListAsync();
}
var query = new ProviderOrganizationCountByOrganizationIdsQuery(organizationIds);
return await GetCountFromQuery(query);
}
}