public virtual NewlyCreatedGamingGroupResult CreateNewGamingGroup(
string gamingGroupName,
TransactionSource registrationSource,
ApplicationUser currentUser)
{
ValidateGamingGroupName(gamingGroupName);
var gamingGroup = new GamingGroup()
{
OwningUserId = currentUser.Id,
Name = gamingGroupName
};
var newlyCreatedGamingGroupResult = new NewlyCreatedGamingGroupResult();
var newGamingGroup = dataContext.Save<GamingGroup>(gamingGroup, currentUser);
newlyCreatedGamingGroupResult.NewlyCreatedGamingGroup = newGamingGroup;
//commit changes since we'll need the GamingGroup.Id
dataContext.CommitAllChanges();
var newlyCreatedPlayer = this.AssociateUserWithGamingGroup(currentUser, newGamingGroup);
newlyCreatedGamingGroupResult.NewlyCreatedPlayer = newlyCreatedPlayer;
new Task(() => eventTracker.TrackGamingGroupCreation(registrationSource)).Start();
return newlyCreatedGamingGroupResult;
}