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 PuestoRepo : IPuestoRepo
|
|
{
|
|
private readonly RECHUMAContext _Context;
|
|
|
|
public PuestoRepo(RECHUMAContext Context)
|
|
{
|
|
_Context = Context;
|
|
}
|
|
|
|
public Task<bool> DeletePuesto(int IdPuesto)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public async Task<Puesto> GetPuesto(int IdPuesto)
|
|
{
|
|
try
|
|
{
|
|
var puesto = await _Context.Puesto.Where(p => p.IdPuesto == IdPuesto).FirstOrDefaultAsync();
|
|
return puesto;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
}
|
|
|
|
public async Task<IEnumerable<Puesto>> GetPuestos()
|
|
{
|
|
try
|
|
{
|
|
var puestos = await _Context.Puesto.AsNoTracking().ToListAsync();
|
|
return puestos;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
}
|
|
|
|
public Task PostUniversidad(Puesto puesto)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<bool> PutPuesto(Puesto puesto)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|