using LCU.API.Internal.RepoApi.Repos.Models; using LCU.API.Internal.RepoApi.Repos.Persistence; using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LCU.API.Internal.RepoApi.Repos.Repositories { public class RepoCompanyRepository : BaseRepository, IRepoCompanyRepository { public RepoCompanyRepository(AppDbContext context) : base(context) { } public async Task> ListAsync() { return await _context.RepoCompanies.ToListAsync(); } public async Task AddAsync(RepoCompany repoCompany) { var result = await _context.RepoCompanies.AddAsync(repoCompany); return result.Entity; } public async Task FindByIdAsync(int id) { return await Queryable.Where(_context.RepoCompanies, x => x.ID == id).FirstOrDefaultAsync(); } public void Update(RepoCompany repoCompany) { _context.RepoCompanies.Update(repoCompany); } public void Remove(RepoCompany repoCompany) { _context.RepoCompanies.Remove(repoCompany); } } }