Ejemplo n.º 1
0
        public long StartNewPoem(StartPoemConfiguration configuration)
        {
            InsertNewUserProfiles(configuration.InvitedPlayers);
            InsertFacebookRequestsForEachInvitedPlayer(
                configuration.AuthorId, configuration.InvitedPlayers, configuration.AssociatedFacebookRequestId);

            using (TransactionScope scope = new TransactionScope())
            {
                var poem = InsertNewPoem(configuration);
                InsertPoemPlayers(configuration.AuthorId, configuration.InvitedPlayers, poem.Id);
                InsertPoemRequestsForPlayers(configuration.AuthorId, poem.Id, configuration.InvitedPlayers);
                InsertInvitationToPoemEventsForEachPlayer(configuration.AuthorId, configuration.InvitedPlayers, poem);
                scope.Complete();
                return poem.Id;
            }
        }
Ejemplo n.º 2
0
 private Poem InsertNewPoem(StartPoemConfiguration configuration)
 {
     Poem poem = configuration.FromConfiguration();
     poemRepository.Insert(poem).Commit();
     return poem;
 }