protected virtual bool GetMatchedRecords( IOrderedEnumerable<IRecord> recordsFilteredByDate, IModelInput modelInput, out IDictionary<string, IList<IRecord>> matchedRecords ) { matchedRecords = new Dictionary<string, IList<IRecord>>(); if (!recordsFilteredByDate.AnySave()) { return false; } foreach (var record in recordsFilteredByDate) { foreach (var term in modelInput.FilterTerms) { var distinctMatchedDescription = GetMatchedDistinctDescription(record.Description, term); record.DistinctDescription = distinctMatchedDescription; if (string.IsNullOrEmpty(distinctMatchedDescription)) { continue; } if (matchedRecords.ContainsKey(distinctMatchedDescription)) { matchedRecords[distinctMatchedDescription].Add(record); } else { matchedRecords.Add(distinctMatchedDescription, new List<IRecord>() { record }); } break; } } return matchedRecords.Any(); }
protected virtual bool GetMatchedRecords ( IOrderedEnumerable <IRecord> recordsFilteredByDate, IModelInput modelInput, out IDictionary <string, IList <IRecord> > matchedRecords ) { matchedRecords = new Dictionary <string, IList <IRecord> >(); if (!recordsFilteredByDate.AnySave()) { return(false); } foreach (var record in recordsFilteredByDate) { foreach (var term in modelInput.FilterTerms) { var distinctMatchedDescription = GetMatchedDistinctDescription(record.Description, term); record.DistinctDescription = distinctMatchedDescription; if (string.IsNullOrEmpty(distinctMatchedDescription)) { continue; } if (matchedRecords.ContainsKey(distinctMatchedDescription)) { matchedRecords[distinctMatchedDescription].Add(record); } else { matchedRecords.Add(distinctMatchedDescription, new List <IRecord>() { record }); } break; } } return(matchedRecords.Any()); }