hechos un par de cambios
This commit is contained in:
@@ -20,7 +20,7 @@ namespace Modelo
|
||||
|
||||
public override Categoria ObtenerPorId(int Tid)
|
||||
{
|
||||
Categoria cat = context.Categorias.Find(Tid);
|
||||
Categoria cat = context.Categorias.First(x => x.Id == Tid);
|
||||
return cat ?? new Categoria();
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Modelo
|
||||
|
||||
public override void Del(Categoria t)
|
||||
{
|
||||
Categoria cat = context.Categorias.Find(t.Id);
|
||||
Categoria cat = context.Categorias.First(x => x.Id == t.Id);
|
||||
if (cat == null) return;
|
||||
context.Categorias.Remove(cat);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user