Esempio n. 1
0
        public bool Insert(TournamentVM tournamentVM)
        {
            using (var scope = new TransactionScope())
            {
                var tournamentId = _tournament.Insert(tournamentVM);

                if (tournamentId == 0)
                {
                    scope.Dispose();
                    return(false);
                }

                if (!_workDay.MakeFixture(tournamentVM.Players, tournamentId))
                {
                    scope.Dispose();
                    return(false);
                }

                scope.Complete();
                return(true);
            }
        }