Ejemplo n.º 1
0
        public async Task <IActionResult> Add([FromForm] UserInformationViewModel userInformation)
        {
            if (ModelState.IsValid)
            {
                var result = await _userInformationService.RegisterUser(userInformation, userInformation.Role);

                if (result == true)
                {
                    return(RedirectToAction("Index", new { searchString = string.Empty }));
                }

                ModelState.AddModelError("", "Something bad happened.");
                return(View());
            }
            return(View());
        }