Nueva mejoras Y estabilidad
This commit is contained in:
35
MieSystem/Services/ExpedienteService.cs
Normal file
35
MieSystem/Services/ExpedienteService.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using MicroORM.Interfaces;
|
||||
using MieSystem.Models;
|
||||
|
||||
namespace MieSystem.Services;
|
||||
|
||||
public class ExpedienteService
|
||||
{
|
||||
private readonly IRepository<Expediente> _repo;
|
||||
|
||||
public ExpedienteService(IRepository<Expediente> expe)
|
||||
{
|
||||
_repo = expe;
|
||||
}
|
||||
|
||||
public Task<int> SaveAsync(Expediente expediente)
|
||||
{
|
||||
return _repo.SaveAsync(expediente);
|
||||
}
|
||||
|
||||
public Task<Expediente?> GetByIdAsync(object id)
|
||||
{
|
||||
return _repo.GetByIdAsync(id);
|
||||
}
|
||||
|
||||
public Task<IEnumerable<Expediente>> GetAllAsync()
|
||||
{
|
||||
return _repo.GetAllAsync();
|
||||
}
|
||||
|
||||
public Task<IEnumerable<Expediente>> GetActivosAsync()
|
||||
{
|
||||
return _repo.GetAllAsync(e=> e.Activo == true);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user