private IEnumerable <DecisionModel> FetchAll() { var decisionBuilders = new List <DecisionModelRssItemConverter>(); foreach (Domaine domaine in this._channels) { DomaineRssFeed feed = this._channels.Find(domaine); foreach (RssItem item in feed.GetSomething(channel => channel.Items())) { DecisionModelRssItemConverter builder = decisionBuilders .SingleOrDefault(decisionBuilder => decisionBuilder.DesignatesSameDecision(item)); if (builder == null) { builder = new DecisionModelRssItemConverter(item); decisionBuilders.Add(builder); } builder.Domaines.Add(domaine); } } return(decisionBuilders.Select(builder => builder.BuildModel())); }
private void StoreDecision(DecisionModel decision) { var converter = new DecisionModelRssItemConverter(decision); RssItem item = converter.BuildItem(); this._channels.RemoveAllOccurences(decision); foreach (Domaine decisionDomaine in decision.Domaines) { DomaineRssFeed feed = this._channels.Find(decisionDomaine); feed.DoSomething(channel => { channel.Add(item); }); } }