65 lines
1.5 KiB
C#
65 lines
1.5 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 PaisRepo : IPaisRepo
|
|
{
|
|
private readonly RECHUMAContext _Context;
|
|
|
|
public PaisRepo(RECHUMAContext Context)
|
|
{
|
|
_Context = Context;
|
|
}
|
|
|
|
public async Task<IEnumerable<Pais>> GetPaises()
|
|
{
|
|
try
|
|
{
|
|
var paises = await _Context.Pais.AsNoTracking().ToListAsync();
|
|
return paises;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
}
|
|
|
|
public Task PostPais(Pais pais)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public async Task<Pais> GetPais(int IdPais)
|
|
{
|
|
try
|
|
{
|
|
var pais = await _Context.Pais.Where(s => s.IdPais == IdPais).FirstOrDefaultAsync();
|
|
return pais;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
}
|
|
|
|
public Task<bool> DeletePais(int IdPais)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<bool> PutPais(Pais pais)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|