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