65 lines
1.6 KiB
C#
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 UniversidadRepo : IUniversidadRepo
|
|
{
|
|
private readonly RECHUMAContext _Context;
|
|
|
|
public UniversidadRepo(RECHUMAContext Context)
|
|
{
|
|
_Context = Context;
|
|
}
|
|
|
|
public Task<bool> DeleteUniversidad(int IdUniversidad)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public async Task<Universidad> GetUniversidad(int IdUniversidad)
|
|
{
|
|
try
|
|
{
|
|
var universidad = await _Context.Universidad.Where(u => u.IdUniversidad == IdUniversidad).FirstOrDefaultAsync();
|
|
return universidad;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
}
|
|
|
|
public async Task<IEnumerable<Universidad>> GetUniversidades()
|
|
{
|
|
try
|
|
{
|
|
var universidades = await _Context.Universidad.AsNoTracking().ToListAsync();
|
|
return universidades;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
throw;
|
|
}
|
|
}
|
|
|
|
public Task PostUniversidad(Universidad universidad)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
public Task<bool> PutUniversidad(Universidad universidad)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|