30 lines
1020 B
C#
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();
|
|
}
|
|
}
|