public void Handle(TeamPracticeRescheduled e)
        {
            var contingent = ContingentPracticePlans.SingleOrDefault(x => x.Id == e.Id);
            var team       = contingent.Teams.SingleOrDefault(x => x.Id == e.TeamId);

            team.PracticeLocation = e.PracticeLocation;
            team.PracticeTime     = e.PracticeTime;
        }
        public void Handle(TeamCreated e)
        {
            var contingent = ContingentPracticePlans.SingleOrDefault(x => x.Id == e.Id);

            contingent.Teams.Add(new Team
            {
                Id   = e.TeamId,
                Name = e.Name
            });
        }
        public void Handle(ContingentAssignedToTournament e)
        {
            var tournament = Tournaments.ContainsKey(e.TournamentId)
                ? Tournaments[e.TournamentId]
                : "2014";

            var contingent = ContingentPracticePlans.SingleOrDefault(x => x.Id == e.Id);

            contingent.TournamentId = e.TournamentId;
            contingent.Year         = tournament;
        }
        public void Handle(ContingentCreated e)
        {
            if (string.IsNullOrWhiteSpace(e.Province))
            {
                return;
            }

            ContingentPracticePlans.Add(
                new ContingentPracticePlan
            {
                Id       = e.Id,
                Province = e.Province,
            });
        }
 public ContingentPracticePlan GetSchedule(string year, string province)
 {
     return(ContingentPracticePlans.SingleOrDefault(x => x.Year == year && x.Province == province));
 }
 public List <ContingentPracticePlan> GetAllSchedules(string year)
 {
     return(ContingentPracticePlans.Where(x => x.Year == year).ToList());
 }
        public void Handle(TeamRemoved e)
        {
            var contingent = ContingentPracticePlans.SingleOrDefault(x => x.Id == e.Id);

            contingent.Teams.RemoveAll(x => x.Id == e.TeamId);
        }