当前位置: 首页>>代码示例>>C#>>正文


C# IntermediateModel.MethodCallExpressionParseInfo类代码示例

本文整理汇总了C#中Remotion.Linq.Parsing.Structure.IntermediateModel.MethodCallExpressionParseInfo的典型用法代码示例。如果您正苦于以下问题:C# MethodCallExpressionParseInfo类的具体用法?C# MethodCallExpressionParseInfo怎么用?C# MethodCallExpressionParseInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


MethodCallExpressionParseInfo类属于Remotion.Linq.Parsing.Structure.IntermediateModel命名空间,在下文中一共展示了MethodCallExpressionParseInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FetchExpressionNodeBase

    public FetchExpressionNodeBase (MethodCallExpressionParseInfo parseInfo, LambdaExpression relatedObjectSelector)
        : base (parseInfo, null, null)
    {
      ArgumentUtility.CheckNotNull ("relatedObjectSelector", relatedObjectSelector);

      var memberExpression = relatedObjectSelector.Body as MemberExpression;
      if (memberExpression == null)
      {
        var message = string.Format (
            "A fetch request must be a simple member access expression; '{0}' is a {1} instead.",
            relatedObjectSelector.Body,
            relatedObjectSelector.Body.GetType ().Name);
        throw new ArgumentException (message, "relatedObjectSelector");
      }

      if (memberExpression.Expression.NodeType != ExpressionType.Parameter)
      {
        var message = string.Format (
            "A fetch request must be a simple member access expression of the kind o => o.Related; '{0}' is too complex.",
            relatedObjectSelector.Body);
        throw new ArgumentException (message, "relatedObjectSelector");
      }

      RelationMember = memberExpression.Member;
    }
开发者ID:GTuritto,项目名称:BrightstarDB,代码行数:25,代码来源:FetchExpressionNodeBase.cs

示例2: GroupJoinExpressionNode

    public GroupJoinExpressionNode (
        MethodCallExpressionParseInfo parseInfo, 
        Expression innerSequence,
        LambdaExpression outerKeySelector,
        LambdaExpression innerKeySelector,
        LambdaExpression resultSelector)
        : base(parseInfo)
    {
      ArgumentUtility.CheckNotNull ("innerSequence", innerSequence);
      ArgumentUtility.CheckNotNull ("outerKeySelector", outerKeySelector);
      ArgumentUtility.CheckNotNull ("innerKeySelector", innerKeySelector);
      ArgumentUtility.CheckNotNull ("resultSelector", resultSelector);

      if (outerKeySelector.Parameters.Count != 1)
        throw new ArgumentException ("Outer key selector must have exactly one parameter.", "outerKeySelector");
      if (innerKeySelector.Parameters.Count != 1)
        throw new ArgumentException ("Inner key selector must have exactly one parameter.", "innerKeySelector");
      if (resultSelector.Parameters.Count != 2)
        throw new ArgumentException ("Result selector must have exactly two parameters.", "resultSelector");

      var joinResultSelector = Expression.Lambda (Expression.Constant (null), outerKeySelector.Parameters[0], innerKeySelector.Parameters[0]);
      JoinExpressionNode = new JoinExpressionNode (parseInfo, innerSequence, outerKeySelector, innerKeySelector, joinResultSelector);
      
      ResultSelector = resultSelector;
      _cachedResultSelector = new ResolvedExpressionCache<Expression> (this);
    }
开发者ID:GTuritto,项目名称:BrightstarDB,代码行数:26,代码来源:GroupJoinExpressionNode.cs

示例3: QueryAnnotationExpressionNode

 public QueryAnnotationExpressionNode(
     MethodCallExpressionParseInfo parseInfo,
     [NotNull] ConstantExpression annotationExpression)
     : base(parseInfo, null, null)
 {
     _annotationExpression = annotationExpression;
 }
开发者ID:adwardliu,项目名称:EntityFramework,代码行数:7,代码来源:QueryAnnotationExpressionNode.cs

示例4: JoinExpressionNode

        public JoinExpressionNode(
        MethodCallExpressionParseInfo parseInfo,
        Expression innerSequence,
        LambdaExpression outerKeySelector,
        LambdaExpression innerKeySelector,
        LambdaExpression resultSelector)
            : base(parseInfo)
        {
            ArgumentUtility.CheckNotNull ("innerSequence", innerSequence);
              ArgumentUtility.CheckNotNull ("outerKeySelector", outerKeySelector);
              ArgumentUtility.CheckNotNull ("innerKeySelector", innerKeySelector);
              ArgumentUtility.CheckNotNull ("resultSelector", resultSelector);

              if (outerKeySelector.Parameters.Count != 1)
            throw new ArgumentException ("Outer key selector must have exactly one parameter.", "outerKeySelector");
              if (innerKeySelector.Parameters.Count != 1)
            throw new ArgumentException ("Inner key selector must have exactly one parameter.", "innerKeySelector");
              if (resultSelector.Parameters.Count != 2)
            throw new ArgumentException ("Result selector must have exactly two parameters.", "resultSelector");

              InnerSequence = innerSequence;
              OuterKeySelector = outerKeySelector;
              InnerKeySelector = innerKeySelector;
              ResultSelector = resultSelector;

              _cachedOuterKeySelector = new ResolvedExpressionCache<Expression> (this);
              _cachedInnerKeySelector = new ResolvedExpressionCache<Expression> (this);
              _cachedResultSelector = new ResolvedExpressionCache<Expression> (this);
        }
开发者ID:nicocrm,项目名称:DotNetSDataClient,代码行数:29,代码来源:JoinExpressionNode.cs

示例5: CreateExpressionNode

        /// <summary>
        /// Creates an instace of type <paramref name="nodeType"/>.
        /// </summary>
        /// <exception cref="ExpressionNodeInstantiationException">
        /// Thrown if the <paramref name="parseInfo"/> or the <paramref name="additionalConstructorParameters"/> 
        /// do not match expected constructor parameters of the <paramref name="nodeType"/>.
        /// </exception>
        public static IExpressionNode CreateExpressionNode(
        Type nodeType, MethodCallExpressionParseInfo parseInfo, object[] additionalConstructorParameters)
        {
            ArgumentUtility.CheckNotNull ("nodeType", nodeType);
              ArgumentUtility.CheckTypeIsAssignableFrom ("nodeType", nodeType, typeof (IExpressionNode));
              ArgumentUtility.CheckNotNull ("additionalConstructorParameters", additionalConstructorParameters);

            #if NETFX_CORE
              var constructors = nodeType.GetTypeInfo().DeclaredConstructors.Where (c => c.IsPublic).ToArray();
            #else
              var constructors = nodeType.GetTypeInfo().GetConstructors().Where (c => c.IsPublic).ToArray();
            #endif
              if (constructors.Length > 1)
              {
            var message = string.Format (
            "Expression node type '{0}' contains too many constructors. It must only contain a single constructor, allowing null to be passed for any optional arguments.",
            nodeType.FullName);
            throw new ArgumentException (message, "nodeType");
              }

              object[] constructorParameterArray = GetParameterArray (constructors[0], parseInfo, additionalConstructorParameters);
              try
              {
            return (IExpressionNode) constructors[0].Invoke (constructorParameterArray);
              }
              catch (ArgumentException ex)
              {
            var message = GetArgumentMismatchMessage (ex);
            throw new ExpressionNodeInstantiationException (message);
              }
        }
开发者ID:nicocrm,项目名称:DotNetSDataClient,代码行数:38,代码来源:MethodCallExpressionNodeFactory.cs

示例6: QuerySourceSetOperationExpressionNodeBase

 protected QuerySourceSetOperationExpressionNodeBase (MethodCallExpressionParseInfo parseInfo, Expression source2)
     : base (parseInfo, null, null)
 {
   ArgumentUtility.CheckNotNull ("source2", source2);
   _source2 = source2;
   _itemType = ReflectionUtility.GetItemTypeOfClosedGenericIEnumerable (parseInfo.ParsedExpression.Type, "expression");
 }
开发者ID:natemcmaster,项目名称:Relinq,代码行数:7,代码来源:QuerySourceSetOperationExpressionNodeBase.cs

示例7: UnionExpressionNode

 public UnionExpressionNode (MethodCallExpressionParseInfo parseInfo, Expression source2)
   : base (parseInfo, null, null)
 {
   ArgumentUtility.CheckNotNull ("source2", source2);
   Source2 = source2;
   ItemType = ReflectionUtility.GetItemTypeOfClosedGenericIEnumerable (parseInfo.ParsedExpression.Type, "expression");
 }
开发者ID:hong1990,项目名称:Relinq,代码行数:7,代码来源:UnionExpressionNode.cs

示例8: SetUp

    public override void SetUp ()
    {
      base.SetUp();

      _keySelector = ExpressionHelper.CreateLambdaExpression<int, short> (i => (short) i);
      _elementSelector = ExpressionHelper.CreateLambdaExpression<int, string> (i => i.ToString());
      _resultSelectorWithElementSelector = 
          ExpressionHelper.CreateLambdaExpression<short, IEnumerable<string>, Tuple<short, int>> ((key, group) => Tuple.Create (key, group.Count()));

      _sourceEnumerable = ExpressionHelper.CreateIntQueryable();

      var methodCallExpressionWithElementSelector = (MethodCallExpression) ExpressionHelper.MakeExpression (
          () => _sourceEnumerable.GroupBy (
              i => (short) i,
              i => i.ToString(),
              (key, group) => Tuple.Create (key, group.Count())));
      _parseInfoWithElementSelector = new MethodCallExpressionParseInfo ("g", SourceNode, methodCallExpressionWithElementSelector);
      _nodeWithElementSelector = new GroupByWithResultSelectorExpressionNode (
          _parseInfoWithElementSelector,
          _keySelector,
          _elementSelector,
          _resultSelectorWithElementSelector);

      var methodCallExpressionWithoutElementSelector = (MethodCallExpression) ExpressionHelper.MakeExpression (
          () => _sourceEnumerable.GroupBy (
              i => (short) i,
              (key, group) => Tuple.Create (key, group.Count())));
      _resultSelectorWithoutElementSelector = 
          ExpressionHelper.CreateLambdaExpression<short, IEnumerable<int>, Tuple<short, int>> ((key, group) => Tuple.Create (key, group.Count()));
      _nodeWithoutElementSelector = new GroupByWithResultSelectorExpressionNode (
          new MethodCallExpressionParseInfo ("g", SourceNode, methodCallExpressionWithoutElementSelector),
          _keySelector,
          _resultSelectorWithoutElementSelector,
          null);
    }
开发者ID:natemcmaster,项目名称:Relinq,代码行数:35,代码来源:GroupByWithResultSelectorExpressionNodeTest.cs

示例9: ThenIncludeExpressionNode

 public ThenIncludeExpressionNode(
     MethodCallExpressionParseInfo parseInfo,
     [NotNull] LambdaExpression navigationPropertyPathLambda)
     : base(parseInfo, null, null)
 {
     _navigationPropertyPathLambda = navigationPropertyPathLambda;
 }
开发者ID:ChuYuzhi,项目名称:EntityFramework,代码行数:7,代码来源:ThenIncludeExpressionNode.cs

示例10: SelectManyExpressionNode

    public SelectManyExpressionNode (
        MethodCallExpressionParseInfo parseInfo, LambdaExpression collectionSelector, LambdaExpression resultSelector)
        : base (parseInfo)
    {
      ArgumentUtility.CheckNotNull ("collectionSelector", collectionSelector);

      if (collectionSelector.Parameters.Count != 1)
        throw new ArgumentException ("Collection selector must have exactly one parameter.", "collectionSelector");

      CollectionSelector = collectionSelector;

      if (resultSelector != null)
      {
        if (resultSelector.Parameters.Count != 2)
          throw new ArgumentException ("Result selector must have exactly two parameters.", "resultSelector");

        ResultSelector = resultSelector;
      }
      else
      {
        var parameter1 = Expression.Parameter (collectionSelector.Parameters[0].Type, collectionSelector.Parameters[0].Name);
        var itemType = ReflectionUtility.GetItemTypeOfClosedGenericIEnumerable (CollectionSelector.Body.Type, "collectionSelector");
        var parameter2 = Expression.Parameter (itemType, parseInfo.AssociatedIdentifier);
        ResultSelector = Expression.Lambda (parameter2, parameter1, parameter2);
      }

      _cachedCollectionSelector = new ResolvedExpressionCache<Expression> (this);
      _cachedResultSelector = new ResolvedExpressionCache<Expression> (this);
    }
开发者ID:hong1990,项目名称:Relinq,代码行数:29,代码来源:SelectManyExpressionNode.cs

示例11: AllExpressionNode

    public AllExpressionNode (MethodCallExpressionParseInfo parseInfo, LambdaExpression predicate)
        : base (parseInfo, null, null)
    {
      ArgumentUtility.CheckNotNull ("predicate", predicate);

      _predicate = predicate;
      _cachedPredicate = new ResolvedExpressionCache<Expression> (this);
    }
开发者ID:natemcmaster,项目名称:Relinq,代码行数:8,代码来源:AllExpressionNode.cs

示例12: IncludeExpressionNode

        public IncludeExpressionNode(
            MethodCallExpressionParseInfo parseInfo,
            [NotNull] LambdaExpression navigationPropertyPathLambda)
            : base(parseInfo, null, null)
        {
            Check.NotNull(navigationPropertyPathLambda, nameof(navigationPropertyPathLambda));

            _navigationPropertyPathLambda = navigationPropertyPathLambda;
        }
开发者ID:rbenhassine2,项目名称:EntityFramework,代码行数:9,代码来源:IncludeExpressionNode.cs

示例13: FromSqlExpressionNode

 public FromSqlExpressionNode(
     MethodCallExpressionParseInfo parseInfo,
     [NotNull] ConstantExpression sql,
     [NotNull] Expression arguments)
     : base(parseInfo, null, null)
 {
     _sql = (string)sql.Value;
     _arguments = arguments;
 }
开发者ID:ChuYuzhi,项目名称:EntityFramework,代码行数:9,代码来源:FromSqlExpressionNode.cs

示例14: WhereMissingExpressionNode

        public WhereMissingExpressionNode(MethodCallExpressionParseInfo parseInfo, LambdaExpression predicate)
            : base(parseInfo)
        {
            if (predicate.Parameters.Count != 1)
                throw new ArgumentException("Predicate must have exactly one parameter.", "predicate");

            Predicate = predicate;
            _cachedPredicate = new ResolvedExpressionCache<Expression>(this);
        }
开发者ID:amccool,项目名称:Linq2Couchbase,代码行数:9,代码来源:WhereMissingExpressionNode.cs

示例15: MethodCallExpressionNodeBase

    protected MethodCallExpressionNodeBase (MethodCallExpressionParseInfo parseInfo)
    {
      if (parseInfo.AssociatedIdentifier == null)
        throw new ArgumentException ("Unitialized struct.", "parseInfo");

      _associatedIdentifier = parseInfo.AssociatedIdentifier;
      _source = parseInfo.Source;
      _nodeResultType = parseInfo.ParsedExpression.Type;
    }
开发者ID:natemcmaster,项目名称:Relinq,代码行数:9,代码来源:MethodCallExpressionNodeBase.cs


注:本文中的Remotion.Linq.Parsing.Structure.IntermediateModel.MethodCallExpressionParseInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。