コード例 #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);
        }
コード例 #2
0
        public void Handle(SeasonCreatedEvent message)
        {
            SeasonRM season = _mapper.Map <SeasonRM>(message);

            _seasonRepo.Save(season);
        }
コード例 #3
0
 public void Save(SeasonRM season)
 {
     Save(season.Year, season);
     MergeIntoAllCollection(season);
 }