Add Patch 3 in API
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 3m46s

This commit is contained in:
Leandro Hernan Rojas 2025-04-03 19:08:33 -03:00
parent 31edbf577f
commit a44f321652
2 changed files with 6 additions and 9 deletions

View File

@ -1,14 +1,15 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Models.Interfaces; using Models.Interfaces;
using Models.Models;
namespace Models.Repositories namespace Models.Repositories
{ {
public class GenericRepository<T> : IGenericRepository<T> where T : class public class GenericRepository<T> : IGenericRepository<T> where T : class
{ {
private readonly DbContext _context; private readonly PhronCareOperationsHubContext _context;
private readonly DbSet<T> _dbSet; private readonly DbSet<T> _dbSet;
public GenericRepository(DbContext context) public GenericRepository(PhronCareOperationsHubContext context)
{ {
_context = context; _context = context;
_dbSet = _context.Set<T>(); _dbSet = _context.Set<T>();

View File

@ -5,14 +5,10 @@ using Models.Models;
namespace Models.Repositories namespace Models.Repositories
{ {
public class PhSAccountTypeRepository : GenericRepository<EAccountType>, IPhSAccountTypeRepository
{
private readonly PhronCareOperationsHubContext _context;
public PhSAccountTypeRepository(PhronCareOperationsHubContext context) : base(context) public class PhSAccountTypeRepository(PhronCareOperationsHubContext context) : GenericRepository<EAccountType>(context), IPhSAccountTypeRepository
{ {
_context = context; private readonly PhronCareOperationsHubContext _context = context;
}
public async Task<EAccountType?> GetByNameAsync(string name) public async Task<EAccountType?> GetByNameAsync(string name)
{ {