public JsonResult GetDemandAggregationDataOnState(DemandAggregationSearchItems search) { bool isSuccess = true; IList <DemandAggregationOnStatesViewModel> data = new List <DemandAggregationOnStatesViewModel>(); var user = HttpContext.Session.Get <UserViewModel>(Constants.SessionKeyUserInfo); user = user ?? new UserViewModel(); try { data = dashboardHandler.GetDemandAggregationOnState(user.UserId, search); } catch (DataNotUpdatedException ex) { Logger.Logger.WriteLog(Logger.Logtype.Error, ex.Message, user.UserId, typeof(DashboardController), ex); isSuccess = false; } return(new JsonResult( new { isSuccess = isSuccess, data = data }, ContractSerializer.JsonInPascalCase() )); }