public UserDBModel CreateAsync(UserDBModel user) { // validation _userAuthenticate.ValidateUser(user); var newUser = _userAuthenticate.AddUserToDatabase(user); var newMessage = _mailService.GenerateMessageForUserVerification(UserController.ClientBaseUrl, TokenManager.GenerateRegisterToken(newUser.VeryficationToken)); _mailService.SendMail(newUser.Email, newMessage.Item1, newMessage.Item2); BackgroundTask task = new BackgroundTask(_logger, _scopeFactory); Task.Factory.StartNew(() => task.RemoveUnverifiedUserAsync(user.VeryficationToken)); return(user); }