コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: dashboardController.cs プロジェクト: yarivat/Admin
        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));
            }
        }