HAY UN AVANCE
This commit is contained in:
@@ -10,7 +10,6 @@ namespace Modelo
|
||||
|
||||
public RepositorioCategoria(Context context)
|
||||
{
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public override List<Categoria> Listar()
|
||||
@@ -20,7 +19,7 @@ namespace Modelo
|
||||
|
||||
public Categoria ObtenerPorId(int Tid)
|
||||
{
|
||||
Categoria cat = context.Categorias.First(x => x.Id == Tid);
|
||||
Categoria cat = context.Categorias.FirstOrDefault(x => x.Id == Tid);
|
||||
return cat ?? new Categoria();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user