public IHttpActionResult GetDataUser([FromUri] GetDataUserRequest obj) { try { // Verify at least object arrives with data if (obj == null) { throw new NotEnoughAttributesException("No se ha recibido ningún parámetro"); } // Verify for parameters needed if (obj.idProduct == 0 || obj.idClient == 0) { throw new NotEnoughAttributesException("No se han recibido todos los parámetros requeridos"); } // Actions into business layer ActionResponse action = core.GetDataUserAction(obj.idProduct, obj.idClient); if (action.code == (int)CodeStatusEnum.OK) { return(ResponseOk(action.data)); } // OK else { return(ResponseError(action.code, action.message)); } // NOK } catch (NotValidDataException e) { logger.Error(e.Message); return(ResponseError((int)CodeStatusEnum.BAD_REQUEST, e.Message)); } catch (NotEnoughAttributesException e) { logger.Error(e.Message); return(ResponseError((int)CodeStatusEnum.BAD_REQUEST, e.Message)); } catch (Exception ex) { logger.Fatal(ex.Message); return(ResponseError((int)CodeStatusEnum.INTERNAL_ERROR, "Error desconocido en el sistema: " + ex.Message)); } }