2025-04-03 11:23:00 -04:00
|
|
|
|
using AutoMapper;
|
|
|
|
|
|
using Bit.Core.Repositories;
|
|
|
|
|
|
using Bit.Infrastructure.EntityFramework.AdminConsole.Models;
|
2025-07-23 14:24:59 -04:00
|
|
|
|
using Bit.Infrastructure.EntityFramework.AdminConsole.Repositories.Queries;
|
2025-04-03 11:23:00 -04:00
|
|
|
|
using Bit.Infrastructure.EntityFramework.Repositories;
|
2025-07-23 14:24:59 -04:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2025-04-03 11:23:00 -04:00
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Bit.Infrastructure.EntityFramework.AdminConsole.Repositories;
|
|
|
|
|
|
|
2025-07-23 14:24:59 -04:00
|
|
|
|
public class OrganizationIntegrationRepository :
|
|
|
|
|
|
Repository<Core.AdminConsole.Entities.OrganizationIntegration, OrganizationIntegration, Guid>,
|
|
|
|
|
|
IOrganizationIntegrationRepository
|
2025-04-03 11:23:00 -04:00
|
|
|
|
{
|
|
|
|
|
|
public OrganizationIntegrationRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper)
|
|
|
|
|
|
: base(serviceScopeFactory, mapper, (DatabaseContext context) => context.OrganizationIntegrations)
|
2025-07-23 14:24:59 -04:00
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async Task<List<Core.AdminConsole.Entities.OrganizationIntegration>> GetManyByOrganizationAsync(Guid organizationId)
|
|
|
|
|
|
{
|
|
|
|
|
|
using (var scope = ServiceScopeFactory.CreateScope())
|
|
|
|
|
|
{
|
|
|
|
|
|
var dbContext = GetDatabaseContext(scope);
|
|
|
|
|
|
var query = new OrganizationIntegrationReadManyByOrganizationIdQuery(organizationId);
|
|
|
|
|
|
return await query.Run(dbContext).ToListAsync();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-04-03 11:23:00 -04:00
|
|
|
|
}
|