BusinessLogic.Logic.Users.UserRegisterer.SignInAndAssociateGamingGroup C# (CSharp) Метод

SignInAndAssociateGamingGroup() приватный Метод

private SignInAndAssociateGamingGroup ( NewUser newUser, ApplicationUser newApplicationUser ) : Task
newUser BusinessLogic.Models.User.NewUser
newApplicationUser ApplicationUser
Результат Task
        private async Task<NewlyRegisteredUser> SignInAndAssociateGamingGroup(NewUser newUser, ApplicationUser newApplicationUser)
        {
            new Task(() => this.eventTracker.TrackUserRegistration(newUser.Source)).Start();

            if (newUser.Source == TransactionSource.WebApplication)
            {
                await this.signInManager.SignInAsync(newApplicationUser, false, false);
            }

            NewlyRegisteredUser newlyRegisteredUser;

            if (newUser.GamingGroupInvitationId.HasValue)
            {
                newlyRegisteredUser = this.gamingGroupInviteConsumer.AddNewUserToGamingGroup(newApplicationUser.Id, newUser.GamingGroupInvitationId.Value);
            }
            else
            {
                newlyRegisteredUser = await this.firstTimeUserAuthenticator.CreateGamingGroupAndSendEmailConfirmation(newApplicationUser, newUser.Source);
            }

            return newlyRegisteredUser;
        }
    }