private static void CombineInstanceCounts(List <Index> combineTo, List <Index> combineFrom) { foreach (Index combineToIndex in combineTo) { foreach (Index combineFromIndex in combineFrom) { if (IndexExtensions.IndexEqualById(combineToIndex, combineFromIndex)) { CombineInstanceCounts(combineToIndex, combineFromIndex); } } } }
public static void AddFieldIndices( this List <Index> indices, AnonymousObject anon, string fieldName, string fieldValueString) { string[] fieldValues = fieldValueString.ParseField(); IDictionary <string, int> fieldValueCounts = AggregateFieldValueCounts(fieldValues); foreach (string fieldValue in fieldValueCounts.Keys) { Index newIndexToAdd = IndexExtensions.CreateNewIndex(fieldName, fieldValue); fieldValueCounts.TryGetValue(fieldValue, out int fieldValueCount); newIndexToAdd.InstanceCounts.Add( InstanceCountExtensions.CreateInstanceCount(newIndexToAdd, anon, fieldValueCount)); indices.Add(newIndexToAdd); } }
private static List <Index> GetIndicesToUpdate(List <Index> combineTo, List <Index> combineFrom) { return(combineTo.Where( t => combineFrom.Any( f => IndexExtensions.IndexEqualById(t, f))).ToList()); }