public IHttpActionResult Get(string id, string parameters = null) { try { ChartHelperForRest helper = new ChartHelperForRest(Map); return(Ok(helper.GetDashboardData(id, parameters))); } catch (DashboardIdIsMissingException exception) { return(ResponseMessage(Request.CreateResponse(HttpStatusCode.NotFound, exception.Message))); } catch (DashboardIdNotFoundException exception) { return(ResponseMessage(Request.CreateResponse(HttpStatusCode.NotFound, exception.Message))); } catch (Exception exception) { throw new BackAndApiUnexpectedResponseException(exception, this); } }
public ActionResult Get(string pk, string parameters) { try { ChartHelperForRest helper = new ChartHelperForRest(Map); return(Json(helper.GetDashboardData(pk, parameters))); } catch (DashboardIdIsMissingException) { return(new DashboardNotFoundApiHttpException(pk, Response)); } catch (DashboardIdNotFoundException) { return(new DashboardNotFoundApiHttpException(pk, Response)); } catch (Exception exception) { return(UnexpectedException(exception, Response)); } }