public ActionResult ReadAjaxServiceDeskGrid([DataSourceRequest] DataSourceRequest request)
        {
            DataSourceResult result = null;

            try
            {
                result = _serviceDeskService.All().Where(x => x.CustomerId == _appUserContext.Current.CurrentCustomer.Id)
                         .ToDataSourceResult(request, Mapper.Map <ServiceDesk, ServiceDeskViewModel>);
            }
            catch (Exception ex)
            {
                _contextManager.ResponseManager.StatusCode = 500;
                _contextManager.ResponseManager.AppendHeader(ModelStateErrorNames.ErrorMessage, ex.Message);
                ExceptionPolicy.HandleException(ex, ExceptionPolicies.General);
            }

            return(Json(result));
        }
Esempio n. 2
0
        public void ServiceDeskService_GetAll_CallsRepositoryAll()
        {
            #region Arrange

            #endregion

            #region Act

            _serviceDeskService.All();

            #endregion

            #region Assert

            _mockServiceDeskRepository.Verify(x => x.All(), Times.Once);

            #endregion
        }