TFS_ANTIGUO/TPAtesa_RecHuma/REC-HUMA.INFRASTRUCTURE/Repositories/ProvinciaRepo.cs
2026-06-26 10:14:39 -06:00

65 lines
1.6 KiB
C#

using Microsoft.EntityFrameworkCore;
using REC_HUMA.CORE.Entities;
using REC_HUMA.CORE.Interfaces;
using REC_HUMA.INFRASTRUCTURE;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace REC_HUMA.INFRASTRUCTURE.Repositories
{
public class ProvinciaRepo : IProvinciaRepo
{
private readonly RECHUMAContext _Context;
public ProvinciaRepo(RECHUMAContext Context)
{
_Context = Context;
}
public async Task<IEnumerable<Provincia>> GetProvincias()
{
try
{
var provincias = await _Context.Provincia.AsNoTracking().ToListAsync();
return provincias;
}
catch (Exception ex)
{
throw;
}
}
public Task PostProvincia(Provincia provincia)
{
throw new NotImplementedException();
}
public async Task<Provincia> GetProvincia(int IdProvincia)
{
try
{
var provincia = await _Context.Provincia.Where(s => s.IdProvincia == IdProvincia).FirstOrDefaultAsync();
return provincia;
}
catch (Exception ex)
{
throw;
}
}
public Task<bool> DeleteProvincia(int IdProvincia)
{
throw new NotImplementedException();
}
public Task<bool> PutProvincia(Provincia provincia)
{
throw new NotImplementedException();
}
}
}