41 lines
1.2 KiB
C#
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);
|
|
}
|
|
}
|
|
|
|
}
|