mirror of
https://github.com/bitwarden/server.git
synced 2025-07-02 16:42:50 -05:00
[PM-17449] Add stored proc, EF query, and an integration test for them (#5413)
This commit is contained in:
@ -157,4 +157,25 @@ public class OrganizationDomainRepository : Repository<Core.Entities.Organizatio
|
||||
dbContext.OrganizationDomains.RemoveRange(expiredDomains);
|
||||
return await dbContext.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<Core.Entities.OrganizationDomain>> GetVerifiedDomainsByOrganizationIdsAsync(
|
||||
IEnumerable<Guid> organizationIds)
|
||||
{
|
||||
using var scope = ServiceScopeFactory.CreateScope();
|
||||
var dbContext = GetDatabaseContext(scope);
|
||||
|
||||
var verifiedDomains = await (from d in dbContext.OrganizationDomains
|
||||
where organizationIds.Contains(d.OrganizationId) && d.VerifiedDate != null
|
||||
select new OrganizationDomain
|
||||
{
|
||||
OrganizationId = d.OrganizationId,
|
||||
DomainName = d.DomainName
|
||||
})
|
||||
.AsNoTracking()
|
||||
.ToListAsync();
|
||||
|
||||
return Mapper.Map<List<OrganizationDomain>>(verifiedDomains);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user