using System.Collections.ObjectModel; using Entidades; using Microsoft.EntityFrameworkCore; 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 bool Guardar(AlquilaFacilContext context) { bool ret = false; try { context.SaveChanges(); context.Dispose(); ret = true; } catch (DbUpdateException ex) { Console.Error.WriteLine(ex.Message); } return ret; } }