using Entidades; using Microsoft.EntityFrameworkCore; using Modelo.Facade; namespace Modelo; public abstract class RepositorioBase where S : new() { protected AlquilaFacilContext Context { get { return new AlquilaFacilContext(); }} private static readonly S instance = new(); public static S Singleton { get { return instance; }} public void GenerarLog(AlquilaFacilContext context, long dni, string accion) { var Auditoria = new AuditoriaFacade(context); Auditoria.GenerarLog(dni, accion??""); return; } public bool Guardar(AlquilaFacilContext context) { bool ret = false; try { context.SaveChanges(); context.Dispose(); ret = true; } catch (Exception ex) { Console.Error.WriteLine(ex.Message); } return ret; } }