Files
2026-03-13 09:27:34 -05:00

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 BodyStyleRepository : BaseRepository, IBodyStyleRepository
{
public BodyStyleRepository(AppDbContext context) : base(context)
{
}
public async Task<IEnumerable<BodyStyle>> ListAllAsync()
{
return await _context.BodyStyleCodes.ToListAsync();
}
public async Task AddAsync(BodyStyle bodyStyleCodes)
{
await _context.BodyStyleCodes.AddAsync(bodyStyleCodes);
}
public async Task<BodyStyle> 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);
}
}
}