40 lines
1.1 KiB
C#
40 lines
1.1 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 HoldStatusRepository : BaseRepository, IHoldStatusRepository
|
|
{
|
|
|
|
public HoldStatusRepository(AppDbContext context) : base(context)
|
|
{
|
|
}
|
|
|
|
public async Task<IEnumerable<HoldStatus>> ListAllAsync()
|
|
{
|
|
return await _context.HoldStatusCodes.ToListAsync();
|
|
}
|
|
|
|
public async Task AddAsync(HoldStatus holdStatusCodes)
|
|
{
|
|
await _context.HoldStatusCodes.AddAsync(holdStatusCodes);
|
|
}
|
|
|
|
public async Task<HoldStatus> FindByIdAsync(int id)
|
|
{
|
|
return await _context.HoldStatusCodes.Where(c => c.Code == id).FirstOrDefaultAsync();
|
|
}
|
|
|
|
public void Update(HoldStatus category)
|
|
{
|
|
_context.HoldStatusCodes.Update(category);
|
|
}
|
|
|
|
public void Remove(HoldStatus category)
|
|
{
|
|
_context.HoldStatusCodes.Remove(category);
|
|
}
|
|
}
|
|
}
|