Exemple #1
0
        // GET: AppSetting/Details/5
        public ActionResult Details(string key)
        {
            AppSettingViewModel appSettingViewModel;

            try
            {
                appSettingViewModel = _mapper.Map <AppSettingViewModel>(_appSettingService.Single(new AppSetting {
                    Key = key
                }));
            }
            catch (Exception ex)
            {
                _logger.Error(ex);
                if (ex.InnerException != null && ex.InnerException.Source.Equals(GeneralMessages.ExceptionSource))
                {
                    ModelState.AddModelError(string.Empty, ex.Message);
                }
                else
                {
                    ModelState.AddModelError(string.Empty, GeneralMessages.UnexpectedError);
                }
                return(View());
            }

            return(View(appSettingViewModel));
        }