Пример #1
0
        public async Task <ActionResult> Create(CountryVM model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            OperationResult result = await _countryManager.CreateAsync(model.Name);

            if (result.Type == ResultType.Success)
            {
                //_toast.AddSuccessToastMessage("Country has been successfully created");
                //return View();
                return(RedirectToAction(nameof(List)));
            }

            ModelState.AddModelError(nameof(model.Name), result.BuildMessage());

            return(View(model));
        }