Example #1
0
        public async Task <UserVm> RegisterUser(NewUserParams newUser)
        {
            var user   = new User(newUser);
            var result = await _userRepository.SaveUser(user);

            return(_mapper.Map <UserVm>(result));
        }
Example #2
0
 public User(NewUserParams newUser)
 {
     Username  = newUser.Username;
     Password  = newUser.Password;
     CreatedOn = DateTime.UtcNow;
     UpdatedOn = DateTime.UtcNow;
     Detail    = new UserDetail();
     Todos     = new List <Todo>();
 }
Example #3
0
        public async Task <IActionResult> Register([FromBody] NewUserParams newUser)
        {
            var user = await _userService.RegisterUser(newUser);

            return(new OkObjectResult(user));
        }