29 lines
614 B
C#
29 lines
614 B
C#
using Microsoft.EntityFrameworkCore;
|
|
|
|
namespace Modelo
|
|
{
|
|
public abstract class Repositorio<T>
|
|
{
|
|
protected Context context;
|
|
public abstract List<T> Listar();
|
|
public abstract void Add(T t);
|
|
public abstract void Del(T t);
|
|
public abstract void Mod(T t);
|
|
|
|
public bool Guardar()
|
|
{
|
|
bool ret = false;
|
|
try
|
|
{
|
|
context.SaveChanges();
|
|
ret = true;
|
|
}
|
|
catch (DbUpdateException)
|
|
{
|
|
throw;
|
|
}
|
|
|
|
return ret;
|
|
}
|
|
}
|
|
} |