Example #1
0
        public async Task<IActionResult> Index()
        {
            var blog = await m_blogService.GetBlogAsync();
            var model = new SettingsViewModel
            {
                Blog = new BlogViewModel(blog)
            };

            return View(model);
        }
Example #2
0
        public async Task<IActionResult> Index(SettingsViewModel model)
        {
            if(ModelState.IsValid)
            {
                var blog = await m_blogService.GetBlogAsync();
                blog.Title = model.Blog.Title;

                await m_blogService.UpdateBlogAsync(blog);
            }

            return View(model);
        }