All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 5m18s
28 lines
1.1 KiB
C#
28 lines
1.1 KiB
C#
using Domain.Entities;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Models.Helpers;
|
|
using Models.Interfaces;
|
|
using Models.Models;
|
|
|
|
namespace Models.Repositories
|
|
{
|
|
public class PhOhTaxConditionRepository(PhronCareOperationsHubContext context): IPhSTaxConditionRepository
|
|
{
|
|
#region Declaraciones y Constructor
|
|
private readonly PhronCareOperationsHubContext _context = context;
|
|
#endregion
|
|
#region Metodos de clase
|
|
async Task<IEnumerable<ETaxCondition>> IPhSTaxConditionRepository.GetAllAsync()
|
|
{
|
|
var accountTypes = await _context.PhOhTaxConditions.ToListAsync();
|
|
return accountTypes.Select(EntityMapper.MapEntity<PhOhTaxCondition, ETaxCondition>);
|
|
}
|
|
public async Task<ETaxCondition?> GetByNameAsync(string name)
|
|
{
|
|
var taxDescription = await _context.PhOhTaxConditions.FirstOrDefaultAsync(a => a.Description.Contains(name));
|
|
return taxDescription != null ? EntityMapper.MapEntity<PhOhTaxCondition, ETaxCondition>(taxDescription) : null;
|
|
}
|
|
#endregion
|
|
}
|
|
}
|