1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-04 01:22:50 -05:00

Run formatting (#2230)

This commit is contained in:
Justin Baur
2022-08-29 16:06:55 -04:00
committed by GitHub
parent 9b7aef0763
commit 7f5f010e1e
1205 changed files with 73813 additions and 75022 deletions

View File

@ -6,31 +6,30 @@ using Bit.Infrastructure.EntityFramework.Repositories.Queries;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace Bit.Infrastructure.EntityFramework.Repositories
namespace Bit.Infrastructure.EntityFramework.Repositories;
public class ProviderOrganizationRepository :
Repository<ProviderOrganization, Models.ProviderOrganization, Guid>, IProviderOrganizationRepository
{
public class ProviderOrganizationRepository :
Repository<ProviderOrganization, Models.ProviderOrganization, Guid>, IProviderOrganizationRepository
public ProviderOrganizationRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper)
: base(serviceScopeFactory, mapper, context => context.ProviderOrganizations)
{ }
public async Task<ICollection<ProviderOrganizationOrganizationDetails>> GetManyDetailsByProviderAsync(Guid providerId)
{
public ProviderOrganizationRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper)
: base(serviceScopeFactory, mapper, context => context.ProviderOrganizations)
{ }
public async Task<ICollection<ProviderOrganizationOrganizationDetails>> GetManyDetailsByProviderAsync(Guid providerId)
using (var scope = ServiceScopeFactory.CreateScope())
{
using (var scope = ServiceScopeFactory.CreateScope())
{
var dbContext = GetDatabaseContext(scope);
var query = new ProviderOrganizationOrganizationDetailsReadByProviderIdQuery(providerId);
var data = await query.Run(dbContext).ToListAsync();
return data;
}
}
public async Task<ProviderOrganization> GetByOrganizationId(Guid organizationId)
{
using var scope = ServiceScopeFactory.CreateScope();
var dbContext = GetDatabaseContext(scope);
return await GetDbSet(dbContext).Where(po => po.OrganizationId == organizationId).FirstOrDefaultAsync();
var query = new ProviderOrganizationOrganizationDetailsReadByProviderIdQuery(providerId);
var data = await query.Run(dbContext).ToListAsync();
return data;
}
}
public async Task<ProviderOrganization> GetByOrganizationId(Guid organizationId)
{
using var scope = ServiceScopeFactory.CreateScope();
var dbContext = GetDatabaseContext(scope);
return await GetDbSet(dbContext).Where(po => po.OrganizationId == organizationId).FirstOrDefaultAsync();
}
}