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); }
public void Handle(SeasonCreatedEvent message) { SeasonRM season = _mapper.Map <SeasonRM>(message); _seasonRepo.Save(season); }
public void Save(SeasonRM season) { Save(season.Year, season); MergeIntoAllCollection(season); }