public IActionResult Create(LocationCreateViewModel model)
 {
     if (!ModelState.IsValid)
     {
         return(View(model));
     }
     model.Persist(repositoryFactory);
     return(RedirectToAction(actionName: nameof(Index)));
 }
Esempio n. 2
0
        public IActionResult Create(LocationCreateViewModel model)
        {
            if (!ModelState.IsValid)
            {
                model.ResetCategoryList(context);
                return(View(model));
            }

            model.Persist(context);
            return(RedirectToAction(actionName: nameof(Index)));
        }