Esempio n. 1
0
        public async Task<IdentityResult> RegisterUser(UserViewModel userViewModel)
        {
			HumanPlayer user = new HumanPlayer
            {
                UserName = userViewModel.UserName
            };

            var result = await _userManager.CreateAsync(user, userViewModel.Password);

            return result;
        }
Esempio n. 2
0
        public async Task<IHttpActionResult> Register(UserViewModel userViewModel)
        {
             if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

             IdentityResult result = await _repo.RegisterUser(userViewModel);

             IHttpActionResult errorResult = GetErrorResult(result);

             if (errorResult != null)
             {
                 return errorResult;
             }

             return Ok();
        }