42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using LCU.Shared.Collections.RepoApiLib.Models.Settings;
|
|
using LCU.Shared.Collections.RepoApiLib.Persistence;
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace LCU.Shared.Collections.RepoApiLib.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);
|
|
}
|
|
}
|
|
} |