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