Пример #1
0
        public IActionResult General(GeneralSettingsViewModel model)
        {
            if (ModelState.IsValid)
            {
                _blogConfig.DisharmonyWords = model.DisharmonyWords;
                _blogConfig.MetaAuthor      = model.MetaAuthor;
                _blogConfig.MetaKeyword     = model.MetaKeyword;
                _blogConfig.SiteTitle       = model.SiteTitle;
                _blogConfig.EnableComments  = model.EnableComments;

                var response = _blogConfigurationService.SaveGeneralSettings(_blogConfig);
                _blogConfig.DumpOldValuesWhenNextLoad();
                return(Json(response));
            }
            return(Json(new FailedResponse((int)ResponseFailureCode.InvalidModelState, "Invalid ModelState")));
        }