コード例 #1
0
    public override void SetUp ()
    {
      base.SetUp ();

      _cookSource = new MainSourceExpressionNode ("s", Expression.Constant (new[] { new Cook () }));
      _cookClause = ExpressionHelper.CreateMainFromClause<Cook> ();
      ClauseGenerationContext.AddContextInfo (_cookSource, _cookClause);

      _ofTypeWithChefMethod = ReflectionUtility.GetMethod (() => ((IQueryable<Cook[]>) null).OfType<Chef> ());
      _node = new OfTypeExpressionNode (CreateParseInfo (_cookSource, "s", _ofTypeWithChefMethod));
    }
コード例 #2
0
        private QueryModel WrapQueryModel(QueryModel queryModel, string associatedIdentifier, ClauseGenerationContext clauseGenerationContext)
        {
            var subQueryExpression = new SubQueryExpression(queryModel);

            // change the Source of this node so that Resolve will later correctly go to the new main from clause we create for the sub query
            var newMainSourceNode = new MainSourceExpressionNode(associatedIdentifier, subQueryExpression);

            Source = newMainSourceNode;

            return(newMainSourceNode.Apply(null, clauseGenerationContext));
        }
コード例 #3
0
    public void SetUp ()
    {
      _methodInfoBasedNodeTypeRegistry = new MethodInfoBasedNodeTypeRegistry ();

      _methodInfoBasedNodeTypeRegistry.Register (WhereExpressionNode.GetSupportedMethods(), typeof (WhereExpressionNode));
      _methodInfoBasedNodeTypeRegistry.Register (SelectExpressionNode.GetSupportedMethods(), typeof (SelectExpressionNode));
      _methodInfoBasedNodeTypeRegistry.Register (TakeExpressionNode.GetSupportedMethods(), typeof (TakeExpressionNode));
      _methodInfoBasedNodeTypeRegistry.Register (CountExpressionNode.GetSupportedMethods(), typeof (CountExpressionNode));
      _methodInfoBasedNodeTypeRegistry.Register (JoinExpressionNode.GetSupportedMethods(), typeof (JoinExpressionNode));

      _parser = new MethodCallExpressionParser (_methodInfoBasedNodeTypeRegistry);

      _source = ExpressionNodeObjectMother.CreateMainSource();
    }
コード例 #4
0
 public override void SetUp ()
 {
   base.SetUp ();
   _node = ExpressionNodeObjectMother.CreateMainSource ();
 }
コード例 #5
0
 public void SetUp ()
 {
   _node = ExpressionNodeObjectMother.CreateMainSource ();
   _context = new ClauseGenerationContext (new MethodInfoBasedNodeTypeRegistry ());
   _clause = ExpressionHelper.CreateMainFromClause_Int ();
 }
コード例 #6
0
    private QueryModel WrapQueryModel (QueryModel queryModel, string associatedIdentifier, ClauseGenerationContext clauseGenerationContext)
    {
      var subQueryExpression = new SubQueryExpression (queryModel);

      // change the Source of this node so that Resolve will later correctly go to the new main from clause we create for the sub query
      var newMainSourceNode = new MainSourceExpressionNode (associatedIdentifier, subQueryExpression);
      _source = newMainSourceNode;

      return newMainSourceNode.Apply (null, clauseGenerationContext);
    }