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 CleaningLevelRepository : BaseRepository, ICleaningLevelRepository
|
|
{
|
|
|
|
public CleaningLevelRepository(AppDbContext context) : base(context)
|
|
{
|
|
}
|
|
|
|
public async Task<IEnumerable<CleaningLevel>> ListAllAsync()
|
|
{
|
|
return await _context.CleaningLevelCodes.ToListAsync();
|
|
}
|
|
|
|
public async Task AddAsync(CleaningLevel cleaningLevelCodes)
|
|
{
|
|
await _context.CleaningLevelCodes.AddAsync(cleaningLevelCodes);
|
|
}
|
|
|
|
public async Task<CleaningLevel> FindByIdAsync(int id)
|
|
{
|
|
return await _context.CleaningLevelCodes.Where(c => c.Code == id).FirstOrDefaultAsync();
|
|
}
|
|
|
|
public void Update(CleaningLevel category)
|
|
{
|
|
_context.CleaningLevelCodes.Update(category);
|
|
}
|
|
|
|
public void Remove(CleaningLevel category)
|
|
{
|
|
_context.CleaningLevelCodes.Remove(category);
|
|
}
|
|
}
|
|
}
|