Beispiel #1
0
 public async Task CreateGallery(GalleryCreateVM viewModel)
 {
     context.Gallery.Add(new Gallery {
         Name = viewModel.Name
     });
     await context.SaveChangesAsync();
 }
Beispiel #2
0
        public async Task <IActionResult> Create(GalleryCreateVM viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(View(viewModel));
            }

            await service.CreateGallery(viewModel);

            return(RedirectToAction(nameof(Index)));
        }