public async Task<NewlyRegisteredUser> CreateGamingGroupAndSendEmailConfirmation(
ApplicationUser applicationUser,
TransactionSource registrationSource)
{
//fetch this first since we want to fail as early as possible if the config entry is missing
var callbackUrl = this.GetCallbackUrlFromConfig();
NewlyCreatedGamingGroupResult result = this.gamingGroupSaver.CreateNewGamingGroup(
applicationUser.UserName + "'s Gaming Group",
registrationSource,
applicationUser);
await this.SendConfirmationEmail(applicationUser, callbackUrl);
return new NewlyRegisteredUser
{
GamingGroupId = result.NewlyCreatedGamingGroup.Id,
GamingGroupName = result.NewlyCreatedGamingGroup.Name,
PlayerId = result.NewlyCreatedPlayer.Id,
PlayerName = result.NewlyCreatedPlayer.Name,
UserId = applicationUser.Id
};
}