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 BodyStyleRepository : BaseRepository, IBodyStyleRepository { public BodyStyleRepository(AppDbContext context) : base(context) { } public async Task> ListAllAsync() { return await _context.BodyStyleCodes.ToListAsync(); } public async Task AddAsync(BodyStyle bodyStyleCodes) { await _context.BodyStyleCodes.AddAsync(bodyStyleCodes); } public async Task FindByIdAsync(string id) { return await _context.BodyStyleCodes.Where(c => c.Code.Equals(id)).FirstOrDefaultAsync(); } public void Update(BodyStyle category) { _context.BodyStyleCodes.Update(category); } public void Remove(BodyStyle category) { _context.BodyStyleCodes.Remove(category); } } }