Exemple #1
0
        public async Task UpdateAsync(Page page)
        {
            page.NormalizedName = page.Name?.ToLower();
            page.NormalizedPermalink = page.Permalink?.ToLower();

            _pageRepository.Update(page);
            await _storage.CommitAsync();
        }
Exemple #2
0
        public async Task<IActionResult> Create(CreatePageViewModel viewModel)
        {
            if (ModelState.IsValid)
            {
                var dbPage = new Page
                {
                    Id = Guid.NewGuid(),
                    Name = viewModel.Name,
                    Title = viewModel.Title,
                    Permalink = viewModel.Permalink
                };

                await _pageService.CreateAsync(dbPage);
                return RedirectToAction(nameof(Index));
            }

            return View(viewModel);
        }
Exemple #3
0
 public void Update(Page page)
 {
     _pageRepository.Update(page);
 }