public async Task <ActionResult <DtoUser> > Create([FromBody] DtoUserRegistration model) { Logger.LogInformation("UserController.Create: POST: api/v1/users"); var newModel = await this.appServiceUser.CreateUserAccount(model); if (this.appServiceUser.HasNotifications()) { return(BadRequest(this.appServiceUser.Notifications())); } return(Ok(newModel)); }
// Writing(Persistence): public async Task <DtoUser> CreateUserAccount(DtoUserRegistration dtoUser) { var currentUser = this.mapper.Map <User>(dtoUser); var newUser = await this.serviceUser.CreateUserAccount(currentUser); if (this.serviceUser.HasNotifications()) { this.NewNotifications(this.serviceUser.Notifications()); } return(this.mapper.Map <DtoUser>(newUser)); }