Exemple #1
0
 public async Task <IActionResult> Create(ProductGroupViewModel productGroupViewModel)
 {
     if (ModelState.IsValid)
     {
         var productGroupsModel = _mapper.Map <ProductGroup>(productGroupViewModel);
         _productGroupRepository.InsertEntity(productGroupsModel);
         _productGroupRepository.Save();
         return(RedirectToAction(nameof(Index)));
     }
     return(View(productGroupViewModel));
 }