refactor: arreglado formato de los repositorios

Signed-off-by: fede <federico.nicolas.polidoro@gmail.com>
This commit is contained in:
2024-10-19 17:59:01 -03:00
parent 9487546fd6
commit c6a9a5dcce
2 changed files with 37 additions and 18 deletions

View File

@@ -4,12 +4,17 @@ using Microsoft.EntityFrameworkCore;
namespace Modelo;
public abstract class RepositorioBase<T> where T : class, new()
public abstract class RepositorioBase<T, S>
where T : class, new()
where S : new()
{
protected AlquilaFacilContext Context { get; set; } = new AlquilaFacilContext();
public abstract ReadOnlyCollection<T> Listar();
private static readonly S instance = new();
public static S Singleton { get{return instance;}}
public bool Guardar(){
bool ret = false;
try
@@ -24,5 +29,4 @@ public abstract class RepositorioBase<T> where T : class, new()
}
return ret;
}
}