feat: implement core domain models, authentication service, and UI components for the attendance system
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Asistencia.Models;
|
||||
|
||||
namespace Asistencia.Data.Repositories;
|
||||
|
||||
public class CursoRepository
|
||||
{
|
||||
private readonly AppDbContext _context;
|
||||
|
||||
public CursoRepository(AppDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
public async Task<List<CursoAbierto>> BuscarCursosPorProfesorAsync(string profesorRun)
|
||||
{
|
||||
return await _context.CursosAbiertos
|
||||
.Include(c => c.Curso)
|
||||
.Where(c => c.ProfesorRun == profesorRun)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
public async Task<CursoAbierto?> BuscarCursoAbiertoPorIdAsync(int idCursoAbierto)
|
||||
{
|
||||
return await _context.CursosAbiertos
|
||||
.Include(c => c.Curso)
|
||||
.FirstOrDefaultAsync(c => c.IdCursoAbierto == idCursoAbierto);
|
||||
}
|
||||
|
||||
public async Task<List<DetalleContrato>> BuscarAlumnosPorCursoAsync(int idCursoAbierto)
|
||||
{
|
||||
return await _context.DetallesContrato
|
||||
.Where(d => d.IdCursoAbierto == idCursoAbierto)
|
||||
.ToListAsync();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user