Files
monorepo/LCU.API.Internal.MemberPreferencesApi/LCU.API.Internal.MemberPreferencesApiLib/Repositories/DnaAuditProcessRepository.cs
T
2026-04-07 13:11:39 -05:00

30 lines
1020 B
C#

using LCU.API.Internal.MemberPreferencesApiLib.Persistence;
using LCU.Library.Internal.MemberPreferencesApiModels.Entities;
using LCU.Library.Internal.MemberPreferencesApiModels.Enums;
using Microsoft.EntityFrameworkCore;
namespace LCU.API.Internal.MemberPreferencesApiLib.Repositories;
public class DnaAuditProcessRepository : BaseRepository, IDnaAuditProcessRepository
{
public DnaAuditProcessRepository(IApplicationDbContext context) : base(context)
{
}
public async Task<IReadOnlyCollection<DnaAuditProcess>> GetAllDnaAuditProcesses()
{
return await _context.DnaAuditProcesses.ToListAsync();
}
public async Task<DnaAuditProcess> GetDnaAuditProcessByDnaProcessType(DnaAuditProcessType type)
{
return await _context.DnaAuditProcesses.Where(d => d.DnaProcessType == type).FirstOrDefaultAsync();
}
public async Task Update(DnaAuditProcess existing)
{
_context.DnaAuditProcesses.Update(existing);
await _context.SaveChangesAsync();
}
}