Example #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);
             }
         }
     }
 }
Example #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);
            }
        }
Example #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());
 }