Esempio n. 1
0
        public async Task <IActionResult> New(RoleViewModel model)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    await _roleManager.CreateAsync(model.MapToModel());

                    //TODO need to add extension .WithSuccess
                    return(RedirectToAction(nameof(Index)));
                }

                //TODO need to add .WithError
                return(View(model));
            }
            catch
            {
                return(RedirectToAction(nameof(Index)));
            }
        }