1
0
mirror of https://github.com/bitwarden/server synced 2025-12-17 00:33:23 +00:00

[AC-432] Checking if any of the selected Organizations is already assigned to a Provider

This commit is contained in:
Rui Tome
2023-04-06 12:18:27 +01:00
parent c613af6bba
commit 141786dc8d
7 changed files with 73 additions and 1 deletions

View File

@@ -67,4 +67,16 @@ public class ProviderOrganizationRepository :
return data;
}
}
public async Task<IEnumerable<ProviderOrganization>> GetManyByOrganizationIdsAsync(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();
}
}
}