implementado login a travez de coockies
This commit is contained in:
@@ -7,22 +7,19 @@ namespace Modelo;
|
||||
public abstract class RepositorioBase<S>
|
||||
where S : new()
|
||||
{
|
||||
protected AlquilaFacilContext Context { get; set; } = new AlquilaFacilContext();
|
||||
|
||||
protected AlquilaFacilContext Context { get{ return new AlquilaFacilContext();}}
|
||||
private static readonly S instance = new();
|
||||
public static S Singleton { get{return instance;}}
|
||||
|
||||
public bool Guardar(){
|
||||
public bool Guardar(AlquilaFacilContext context){
|
||||
bool ret = false;
|
||||
try
|
||||
{
|
||||
Context.SaveChanges();
|
||||
Context.Dispose();
|
||||
Context = new AlquilaFacilContext();
|
||||
context.SaveChanges();
|
||||
context.Dispose();
|
||||
ret = true;
|
||||
} catch (DbUpdateException ex)
|
||||
{
|
||||
Context = new AlquilaFacilContext();
|
||||
Console.Error.WriteLine(ex.Message);
|
||||
}
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user