1
0
mirror of https://github.com/bitwarden/server synced 2025-12-14 15:23:42 +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

@@ -99,17 +99,17 @@ public class ProviderOrganizationRepository : Repository<ProviderOrganization, G
}
}
public async Task<IEnumerable<ProviderOrganization>> GetManyByOrganizationIdsAsync(
public async Task<int> GetCountByOrganizationIdsAsync(
IEnumerable<Guid> organizationIds)
{
using (var connection = new SqlConnection(ConnectionString))
{
var results = await connection.QueryAsync<ProviderOrganization>(
$"[{Schema}].[ProviderOrganization_ReadByOrganizationIds]",
var results = await connection.ExecuteScalarAsync<int>(
$"[{Schema}].[ProviderOrganization_ReadCountByOrganizationIds]",
new { Ids = organizationIds.ToGuidIdArrayTVP() },
commandType: CommandType.StoredProcedure);
return results.ToList();
return results;
}
}