HAY UN AVANCE
This commit is contained in:
@@ -4,7 +4,7 @@ namespace Modelo
|
||||
{
|
||||
public abstract class Repositorio<T>
|
||||
{
|
||||
protected Context context;
|
||||
protected Context context = new Context(); //no voy a usar esta instancia igualmente
|
||||
public abstract List<T> Listar();
|
||||
public abstract void Add(T t);
|
||||
public abstract void Del(T t);
|
||||
@@ -16,11 +16,13 @@ namespace Modelo
|
||||
try
|
||||
{
|
||||
context.SaveChanges();
|
||||
context.Dispose();
|
||||
context = new Context();
|
||||
ret = true;
|
||||
}
|
||||
catch (DbUpdateException)
|
||||
catch (DbUpdateException ex)
|
||||
{
|
||||
throw;
|
||||
Console.Error.WriteLine(ex);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user