api para obtener datos de los logs

This commit is contained in:
2025-01-28 01:30:50 -03:00
parent 17fae0e777
commit c7880b03b3
4 changed files with 87 additions and 0 deletions

19
Modelo/RepositorioLogs.cs Normal file
View File

@@ -0,0 +1,19 @@
using System.Linq;
using Entidades;
using Microsoft.EntityFrameworkCore;
namespace Modelo;
public class RepositorioLogs: RepositorioBase<RepositorioLogs> {
public ICollection<LogDetalle> ObtenerDetallesLogs(DateTime fecha, long idusuario) {
var con = Context;
var d = con.Logs.Include(x=>x.LogDetalles)
.FirstOrDefault(x => x.Fecha == fecha && x.Dniusuario == idusuario);
return d.LogDetalles;
}
public IQueryable<Log>? ObtenerLogsPaginado(int pag) {
var con = Context;
var l = con.Logs.Skip(10*pag).Take(10);
return l;
}
}