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 CleaningLevelRepository : BaseRepository, ICleaningLevelRepository { public CleaningLevelRepository(AppDbContext context) : base(context) { } public async Task> ListAllAsync() { return await _context.CleaningLevelCodes.ToListAsync(); } public async Task AddAsync(CleaningLevel cleaningLevelCodes) { await _context.CleaningLevelCodes.AddAsync(cleaningLevelCodes); } public async Task 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); } } }