public IActionResult Get(int id) { try { CategoriaIndOutput data = (CategoriaIndOutput)_manager.SingleById(id, 0); if (data.apiEstado.Equals(Status.Error)) { return(NotFound(data)); } return(Ok(data)); } catch (Exception ex) { _logger.LogError(LoggingEvents.SERVICE_ERROR, ex, ex.Message); return(new EmptyResult()); } }
public SingleQuery SingleById(int id, int idCategoria) { CategoriaIndOutput categoria = new CategoriaIndOutput(); categoria = _repository.ExecuteProcedureSingle <CategoriaIndOutput>(Consultas.DboCategoriaInd, id); if (categoria == null) { categoria = new CategoriaIndOutput { apiMensaje = string.Format(Mensaje.NoExiste, Mensaje.Categoria), apiEstado = Status.Error }; } else { } return(categoria); }