예제 #1
0
 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);
             }
         }
     }
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
 private static List <Index> GetIndicesToUpdate(List <Index> combineTo, List <Index> combineFrom)
 {
     return(combineTo.Where(
                t => combineFrom.Any(
                    f => IndexExtensions.IndexEqualById(t, f))).ToList());
 }