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


C# MethodCallExpression.IsQueryable方法代码示例

本文整理汇总了C#中System.Linq.Expressions.MethodCallExpression.IsQueryable方法的典型用法代码示例。如果您正苦于以下问题:C# MethodCallExpression.IsQueryable方法的具体用法?C# MethodCallExpression.IsQueryable怎么用?C# MethodCallExpression.IsQueryable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Linq.Expressions.MethodCallExpression的用法示例。


在下文中一共展示了MethodCallExpression.IsQueryable方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CanParseMethodCall

		protected override bool CanParseMethodCall(ExpressionParser parser, MethodCallExpression methodCall, SqlQuery sqlQuery)
		{
			return
				methodCall.IsQueryable("SelectMany") &&
				methodCall.Arguments.Count == 3      &&
				((LambdaExpression)methodCall.Arguments[1].Unwrap()).Parameters.Count == 1;
		}
开发者ID:Firebie,项目名称:ItemsUsage,代码行数:7,代码来源:SelectManyParser.cs

示例2: CanBuildMethodCall

        protected override bool CanBuildMethodCall(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo)
        {
            if (!methodCall.IsQueryable("OrderBy", "OrderByDescending", "ThenBy", "ThenByDescending"))
                return false;

            var body = ((LambdaExpression)methodCall.Arguments[1].Unwrap()).Body.Unwrap();

            if (body.NodeType == ExpressionType.MemberInit)
            {
                var mi = (MemberInitExpression)body;
                bool throwExpr;

                if (mi.NewExpression.Arguments.Count > 0 || mi.Bindings.Count == 0)
                    throwExpr = true;
                else
                    throwExpr = mi.Bindings.Any(b => b.BindingType != MemberBindingType.Assignment);

                if (throwExpr)
                    throw new NotSupportedException("Explicit construction of entity type '{0}' in order by is not allowed.".Args(body.Type));
            }

            return true;
        }
开发者ID:petedv,项目名称:linq2db,代码行数:23,代码来源:OrderByBuilder.cs

示例3: CanParseMethodCall

		protected override bool CanParseMethodCall(ExpressionParser parser, MethodCallExpression methodCall, SqlQuery sqlQuery)
		{
			if (!methodCall.IsQueryable("Join", "GroupJoin") || methodCall.Arguments.Count != 5)
				return false;

			var body = ((LambdaExpression)methodCall.Arguments[2].Unwrap()).Body.Unwrap();

			if (body.NodeType == ExpressionType	.MemberInit)
			{
				var mi = (MemberInitExpression)body;
				bool throwExpr;

				if (mi.NewExpression.Arguments.Count > 0 || mi.Bindings.Count == 0)
					throwExpr = true;
				else
					throwExpr = mi.Bindings.Any(b => b.BindingType != MemberBindingType.Assignment);

				if (throwExpr)
					throw new NotSupportedException(string.Format("Explicit construction of entity type '{0}' in join is not allowed.", body.Type));
			}

			return true;
		}
开发者ID:Firebie,项目名称:ItemsUsage,代码行数:23,代码来源:JoinParser.cs

示例4: CanBuildMethodCall

 protected override bool CanBuildMethodCall(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo)
 {
     return methodCall.IsQueryable("LoadWith");
 }
开发者ID:nectide,项目名称:linq2db,代码行数:4,代码来源:LoadWithBuilder.cs

示例5: CanBuildMethodCall

		protected override bool CanBuildMethodCall(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo)
		{
			return methodCall.IsQueryable("DefaultIfEmpty");
		}
开发者ID:x64,项目名称:bltoolkit,代码行数:4,代码来源:DefaultIfEmptyBuilder.cs

示例6: CanParseMethodCall

		protected override bool CanParseMethodCall(ExpressionParser parser, MethodCallExpression methodCall, SqlQuery sqlQuery)
		{
			return methodCall.IsQueryable("Skip", "Take");
		}
开发者ID:Firebie,项目名称:ItemsUsage,代码行数:4,代码来源:TakeSkipParser.cs

示例7: CanBuildMethodCall

		protected override bool CanBuildMethodCall(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo)
		{
			return methodCall.IsQueryable("Where", "Having");
		}
开发者ID:donners77,项目名称:linq2db,代码行数:4,代码来源:WhereBuilder.cs

示例8: CanParseMethodCall

		protected override bool CanParseMethodCall(ExpressionParser parser, MethodCallExpression methodCall, SqlQuery sqlQuery)
		{
			return methodCall.IsQueryable("DefaultIfEmpty");
		}
开发者ID:Firebie,项目名称:ItemsUsage,代码行数:4,代码来源:DefaultIfEmptyParser.cs

示例9: CanBuildMethodCall

		protected override bool CanBuildMethodCall(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo)
		{
			return methodCall.IsQueryable("Concat", "Union") && methodCall.Arguments.Count == 2;
		}
开发者ID:x64,项目名称:bltoolkit,代码行数:4,代码来源:ConcatUnionBuilder.cs

示例10: CanBuildMethodCall

 protected override bool CanBuildMethodCall(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo)
 {
     return methodCall.Arguments.Count == 2 && methodCall.IsQueryable("Except", "Intersect");
 }
开发者ID:henleygao,项目名称:linq2db,代码行数:4,代码来源:IntersectBuilder.cs

示例11: CanBuildMethodCall

		protected override bool CanBuildMethodCall(ExpressionBuilder builder, MethodCallExpression methodCall, BuildInfo buildInfo)
		{
			return methodCall.IsQueryable("TableName", "DatabaseName", "SchemaName", "OwnerName");
		}
开发者ID:donners77,项目名称:linq2db,代码行数:4,代码来源:TableAttributeBuilder.cs


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