This commit is contained in:
Zeeshaun
2026-03-13 09:27:34 -05:00
parent 256f579489
commit a675c5f5b0
381 changed files with 20992 additions and 0 deletions
@@ -0,0 +1,45 @@
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<IReadOnlyCollection<RepoCompany>> ListAsync()
{
return await _context.RepoCompanies.ToListAsync();
}
public async Task<RepoCompany> AddAsync(RepoCompany repoCompany)
{
var result = await _context.RepoCompanies.AddAsync(repoCompany);
return result.Entity;
}
public async Task<RepoCompany> FindByIdAsync(int id)
{
return await Queryable.Where<RepoCompany>(_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);
}
}
}