using Microsoft.EntityFrameworkCore; using RecNet.Domain.Common; using RecNet.Domain.Entities.Profiles; using RecNet.Domain.Repositories; namespace RecNet.Infrastructure.Persistence.Repositories; public class ProfileRepository(DatabaseContext dbContext) : IProfileRepository { public Task GetByIdAsync( Guid profileId, CancellationToken ct = default) => dbContext.Profiles .FirstOrDefaultAsync(x => x.ProfileId == profileId, ct); public async Task> GetByIdsAsync( List profileIds, CancellationToken ct = default) => await dbContext.Profiles .Where(x => profileIds.Contains(x.ProfileId)) .ToListAsync(ct); public Task GetByPlatform( PlatformType platform, string platformId, CancellationToken ct = default) => dbContext.Profiles .FirstOrDefaultAsync(x => x.Platform == platform && x.PlatformId == platformId, ct); public async Task AddAsync( Profile profile, CancellationToken ct = default) => await dbContext.Profiles.AddAsync(profile, ct); public Task SaveChangesAsync(CancellationToken ct = default) => dbContext.SaveChangesAsync(ct); }