예제 #1
0
        private void MergeSearchIndexChanges(SearchFilters searchFilters, SICT addedType)
        {
            if (!SearchChanges.TryGetValue(searchFilters, out var existingType))
            {
                SearchChanges[searchFilters] = addedType;
                return;
            }

            // If the search index change type is the same, move on.
            if (existingType == addedType)
            {
                return;
            }

            var transition = new StateTransition(existingType, addedType);

            if (AcceptableTransitions.TryGetValue(transition, out var result))
            {
                SearchChanges[searchFilters] = result;
                return;
            }

            Guard.Fail($"A {existingType} search index change cannot be replaced with {addedType}.");
        }
예제 #2
0
 public StateTransition(SICT existing, SICT added)
 {
     Existing = existing;
     Added    = added;
 }