Example #1
0
        public static GeneralSeoSettingsView ConvertToViewGeneralSettings(GeneralSeoSettingsModel result)
        {
            var generalSettings = new GeneralSeoSettingsView
            {
                Id      = result.Id,
                Title   = result.Title,
                MainUrl = result.MainUrl
            };

            return(generalSettings);
        }
Example #2
0
        public async Task <IActionResult> General(GeneralSeoSettingsView result)
        {
            if (!ModelState.IsValid)
            {
                return(View(result));
            }

            var generalSettings = await _seoService.GetSeoSettingsById(result.Id);

            await _seoService.SetSeoSettings(SeoHelpers.MergeViewWithModelGeneralSettings(generalSettings, result));

            return(RedirectToAction("General", "Seo"));
        }
Example #3
0
        public static GeneralSeoSettingsModel MergeViewWithModelGeneralSettings(GeneralSeoSettingsModel model, GeneralSeoSettingsView view)
        {
            model.Title   = view.Title;
            model.MainUrl = view.MainUrl;

            return(model);
        }