Ejemplo n.º 1
0
        public async Task <IActionResult> Create(MembersCreateVM newMember)
        {
            if (!ModelState.IsValid)
            {
                return(View(newMember));
            }
            else
            {
                var result = await service.CreateUserAsync(newMember);

                if (result.Succeeded)
                {
                    ModelState.AddModelError(nameof(MembersCreateVM.UserName), "Invalid login credentials");
                    return(RedirectToAction(nameof(Login)));
                }
                else
                {
                    return(View());
                }
            }
        }