Example #1
0
 public async Task <ActionResult> Register(RegisterRequestUser model)
 {
     if (await _service.Register(model))
     {
         return(Ok("registered"));
     }
     return(BadRequest());
 }
Example #2
0
        public async Task <bool> Register(RegisterRequestUser model)
        {
            var user = new User
            {
                UserName = model.Email,
                FullName = model.FullNAme,
                Email    = model.Email,
                Address  = model.Address,
                City     = model.City,
                Zip      = model.Zip
            };
            var result = await UserManager.CreateAsync(user, model.Password);

            if (result.Succeeded)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #3
0
 public Task <bool> Register(RegisterRequestUser model)
 =>
 _repository.Register(model);