예제 #1
0
        public int CreateMatch(List <Round> rounds, Lane lane, Party winner = null)
        {
            var match = new Match {
                Rounds = rounds, Lane = lane
            };

            if (winner != null)
            {
                match.Winner   = winner;
                match.WinnerId = winner.Id;
            }

            _context.Matches.Add(match);
            _context.SaveChanges();
            return(match.Id);
        }
예제 #2
0
 //Match management
 public int CreateMatch(List <Round> rounds, Lane lane, Party winner = null)
 {
     return(_repository.CreateMatch(rounds, lane, winner));
 }