Files
monorepo/LCU.API.Internal.RepoApi/LCU.API.Internal.RepoApi.Repos/Repositories/Settings/AllowedStatusChangeRepository.cs
T
2026-03-13 09:27:34 -05:00

41 lines
1.2 KiB
C#

using LCU.API.Internal.RepoApi.Repos.Models.Settings;
using LCU.API.Internal.RepoApi.Repos.Persistence;
using Microsoft.EntityFrameworkCore;
namespace LCU.API.Internal.RepoApi.Repos.Repositories.Settings
{
public class AllowedStatusChangeRepository : BaseRepository, IAllowedStatusChangeRepository
{
public AllowedStatusChangeRepository(AppDbContext context) : base(context)
{
}
public async Task<IEnumerable<AllowedStatusChange>> ListAllAsync()
{
return await _context.AllowedStatusChanges.ToListAsync();
}
public async Task AddAsync(AllowedStatusChange allowedStatusChanges)
{
await _context.AllowedStatusChanges.AddAsync(allowedStatusChanges);
}
public async Task<AllowedStatusChange> FindByIdAsync(int id)
{
return await _context.AllowedStatusChanges.Where(c => c.ID == id).FirstOrDefaultAsync();
}
public void Update(AllowedStatusChange category)
{
_context.AllowedStatusChanges.Update(category);
}
public void Remove(AllowedStatusChange category)
{
_context.AllowedStatusChanges.Remove(category);
}
}
}