public SingleQuery SingleById(int id, int idSubCategoria) { SubCategoriaIndOutput subcategoria = new SubCategoriaIndOutput(); subcategoria = _repository.ExecuteProcedureSingle <SubCategoriaIndOutput>(Consultas.DboSubCategoriaInd, id); if (subcategoria == null) { subcategoria = new SubCategoriaIndOutput { apiMensaje = string.Format(Mensaje.NoExiste, Mensaje.SubCategoria), apiEstado = Status.Error }; } else { } return(subcategoria); }
public IActionResult Get(int id) { try { SubCategoriaIndOutput data = (SubCategoriaIndOutput)_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()); } }