public void CreateParty(string name, string legalId)
        {
            var party = BowlingFactory.CreateParty(name, legalId);

            _context.Add(party);
            _context.SaveChanges();
        }
        public void CreateCompetition(string competitionName, Guid competitionId, DateTime startDate, DateTime endDate)
        {
            var competition = BowlingFactory.CreateCompetition(competitionId, competitionName, startDate, endDate);

            _context.Competitions.Add(competition);
            _context.SaveChanges();
        }
Beispiel #3
0
        public void CreateLane(string name)
        {
            var laneNo = _lanes.Count() + 1;

            var lane = BowlingFactory.CreateLane(name, laneNo);

            _lanes.Add(lane);
        }
        public void CreateLane(string name)
        {
            var laneNo = _context.Lanes.Count() + 1;

            var lane = BowlingFactory.CreateLane(name, laneNo);

            _context.Add(lane);
            _context.SaveChanges();
        }
Beispiel #5
0
        public void CreateMatch(Competition competition, List <Party> players, int laneNumber)
        {
            var lane = _lanes.FirstOrDefault(l => l.LaneNo == laneNumber);

            var matchNo = _matches.Where(m => m.Competition == competition).Count() + 1;

            var match = BowlingFactory.CreateMatch(competition, players, lane, matchNo);

            _matches.Add(match);
            _competitions.FirstOrDefault(c => c.Id == competition.Id).Matches.Add(match);
        }
        public void CreateMatch(Competition competition, List <Party> players, int laneNumber)
        {
            var lane = _context.Lanes.FirstOrDefault(l => l.LaneNo == laneNumber);

            var matchNo = competition.Matches.Count + 1;

            var match = BowlingFactory.CreateMatch(competition, players, lane, matchNo);

            _context.Competitions.FirstOrDefault(c => c.Id == competition.Id).Matches.Add(match);
            _context.SaveChanges();
        }
Beispiel #7
0
        public void CreateParty(string name, string legalId)
        {
            var party = BowlingFactory.CreateParty(name, legalId);

            _parties.Add(party);
        }