Uploaded image for project: 're-motion'
  1. RM-3704

The constructors of QueryProviderBase, DefaultQueryProvider, and QueryableBase have changed

    Details

    • Type: Breaking Change
    • Status: Closed (View workflow)
    • Priority: Normal
    • Resolution: Fixed
    • Affects versions: None
    • Fix versions: 1.13.92
    • Components: Data.Linq
    • Labels:
      None
    • Sprint:

      Description

      QueryProviderBase, DefaultQueryProvider, and QueryableBase<T> now require an instance of IQueryParser to be passed into their constructors. This has been caused by refactorings made in the course of the addition of new features, and it is easily remedied.

      To create a default query parser:

      var queryParser = QueryParser.CreateDefault();
      

      To create a customized query parser:

      // include default nodes
      var nodeTypeRegistry = MethodCallExpressionNodeTypeRegistry.CreateDefault();
        [customize node parsers here]
      
      // include default transformations
      var transformerRegistry = ExpressionTransformerRegistry.CreateDefault();
        [customize transformers here]
      
      // use default pipeline
      var processingSteps = ExpressionTreeParser.CreateDefaultProcessingSteps (transformerRegistry);
        [customize pipeline steps here]
      
      // create an ordinary QueryParser that uses the objects defined so far
      var expressionTreeParser = new ExpressionTreeParser (nodeTypeRegistry, processingSteps);
      var queryParser = new QueryParser (expressionTreeParser);
      

      (Note that QueryParser does not change state between different queries, so it can be stored and reused with "singleton" semantics. It is of course possible to use a dependency injection container rather than manually composing the parser.)

      Constructor taking IQueryExecutor was changed to also require IQueryParser.

      DerivedQueryProvider (IQueryExecutor executor)
        : base (QueryParser.CreateDefault(), executor)
      {
      }
      

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                fabian.schmied Fabian Schmied
                Reporter:
                andreas.obkircher andreas.obkircher
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: