If

Evaluates a series of child modules for each input document if a specified condition is met.
Any result documents from the child modules will be returned as the result of the this module. Any input documents that don't match a predicate will be returned as outputs without modification.

Usage

  • If(ContextConfig predicate, params IModule[] modules)

    Specifies a predicate and a series of child modules to be evaluated if the predicate returns true. The predicate will be evaluated once for all input documents.

    • predicate

      A predicate delegate that should return a bool.

    • modules

      The modules to execute on documents if the predicate is true.

  • If(DocumentConfig predicate, params IModule[] modules)

    Specifies a predicate and a series of child modules to be evaluated if the predicate returns true. The predicate will be evaluated against every input document individually.

    • predicate

      A predicate delegate that should return a bool.

    • modules

      The modules to execute on documents where the predicate is true.

Fluent Methods

Chain these methods together after the constructor to modify behavior.

  • ElseIf(ContextConfig predicate, params IModule[] modules)

    Specifies an alternate condition to be tested on documents that did not satisfy previous conditions. You can chain together as many ElseIf calls as needed. The predicate will be evaluated once for all input documents.

    • predicate

      A predicate delegate that should return a bool.

    • modules

      The modules to execute on documents if the predicate is true.

  • ElseIf(DocumentConfig predicate, params IModule[] modules)

    Specifies an alternate condition to be tested on documents that did not satisfy previous conditions. You can chain together as many ElseIf calls as needed. The predicate will be evaluated against every input document individually.

    • predicate

      A predicate delegate that should return a bool.

    • modules

      The modules to execute on documents where the predicate is true.

  • WithoutUnmatchedDocuments(bool withoutUnmatchedDocuments = true)

    The default behavior of this module is to "fall through" any documents that didn't match one of the conditions and add it to the result set. This method allows you to change that behavior and prevent unmatched documents from being added to the result set.

    • withoutUnmatchedDocuments

      Set to true to prevent unmatched documents from being added to the resut set.

GitHub