Exemple #1
0
        private void MergeIntoAllCollection(SeasonRM season)
        {
            var allSeasons = new List <SeasonRM>();

            if (Exists("all"))
            {
                allSeasons = Get <List <SeasonRM> >("all");
            }

            // If the season already exists in the ALL collection,
            // remove that entry
            if (allSeasons.Any(x => x.Year == season.Year))
            {
                allSeasons.Remove(allSeasons.First(x => x.Year == season.Year));
            }

            //Add the modified district to the ALL collection
            allSeasons.Add(season);

            Save("all", allSeasons);
        }
Exemple #2
0
        public void Handle(SeasonCreatedEvent message)
        {
            SeasonRM season = _mapper.Map <SeasonRM>(message);

            _seasonRepo.Save(season);
        }
Exemple #3
0
 public void Save(SeasonRM season)
 {
     Save(season.Year, season);
     MergeIntoAllCollection(season);
 }