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


C# EntityQueryModelVisitor.ReplaceClauseReferences方法代码示例

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


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

示例1: HandleAll

        private static Expression HandleAll(
            EntityQueryModelVisitor entityQueryModelVisitor,
            AllResultOperator allResultOperator,
            QueryModel queryModel)
        {
            var sequenceType
                = entityQueryModelVisitor.Expression.Type.GetSequenceType();

            var predicate
                = entityQueryModelVisitor
                    .ReplaceClauseReferences(
                        allResultOperator.Predicate,
                        queryModel.MainFromClause);

            return CallWithPossibleCancellationToken(
                entityQueryModelVisitor.LinqOperatorProvider.All
                    .MakeGenericMethod(sequenceType),
                entityQueryModelVisitor.Expression,
                Expression.Lambda(predicate, entityQueryModelVisitor.CurrentParameter));
        }
开发者ID:adwardliu,项目名称:EntityFramework,代码行数:20,代码来源:ResultOperatorHandler.cs

示例2: HandleAll

        private static Expression HandleAll(
            EntityQueryModelVisitor entityQueryModelVisitor,
            AllResultOperator allResultOperator,
            QueryModel queryModel)
        {
            var predicate
                = entityQueryModelVisitor
                    .ReplaceClauseReferences(
                        allResultOperator.Predicate,
                        queryModel.MainFromClause);

            return CallWithPossibleCancellationToken(
                entityQueryModelVisitor.LinqOperatorProvider.All
                    .MakeGenericMethod(typeof(QuerySourceScope)),
                entityQueryModelVisitor.CreateScope(
                    entityQueryModelVisitor.Expression,
                    entityQueryModelVisitor.StreamedSequenceInfo.ResultItemType,
                    queryModel.MainFromClause),
                Expression.Lambda(predicate, EntityQueryModelVisitor.QuerySourceScopeParameter));
        }
开发者ID:aishaloshik,项目名称:EntityFramework,代码行数:20,代码来源:ResultOperatorHandler.cs

示例3: HandleGroup

        private static Expression HandleGroup(
            EntityQueryModelVisitor entityQueryModelVisitor,
            GroupResultOperator groupResultOperator,
            QueryModel queryModel)
        {
            var keySelector
                = entityQueryModelVisitor
                    .ReplaceClauseReferences(
                        groupResultOperator.KeySelector,
                        queryModel.MainFromClause);

            var elementSelector
                = entityQueryModelVisitor
                    .ReplaceClauseReferences(
                        groupResultOperator.ElementSelector,
                        queryModel.MainFromClause);

            return Expression.Call(
                entityQueryModelVisitor.LinqOperatorProvider.GroupBy
                    .MakeGenericMethod(
                        typeof(QuerySourceScope),
                        groupResultOperator.KeySelector.Type,
                        groupResultOperator.ElementSelector.Type),
                entityQueryModelVisitor.CreateScope(
                    entityQueryModelVisitor.Expression,
                    entityQueryModelVisitor.StreamedSequenceInfo.ResultItemType,
                    queryModel.MainFromClause),
                Expression.Lambda(keySelector, EntityQueryModelVisitor.QuerySourceScopeParameter),
                Expression.Lambda(elementSelector, EntityQueryModelVisitor.QuerySourceScopeParameter));
        }
开发者ID:aishaloshik,项目名称:EntityFramework,代码行数:30,代码来源:ResultOperatorHandler.cs

示例4: HandleDefaultIfEmpty

        private static Expression HandleDefaultIfEmpty(
            EntityQueryModelVisitor entityQueryModelVisitor,
            DefaultIfEmptyResultOperator defaultIfEmptyResultOperator,
            QueryModel queryModel)
        {
            if (defaultIfEmptyResultOperator.OptionalDefaultValue == null)
            {
                return Expression.Call(
                    entityQueryModelVisitor.LinqOperatorProvider.DefaultIfEmpty
                        .MakeGenericMethod(entityQueryModelVisitor.StreamedSequenceInfo.ResultItemType),
                    entityQueryModelVisitor.Expression);
            }

            var optionalDefaultValue
                = entityQueryModelVisitor
                    .ReplaceClauseReferences(
                        defaultIfEmptyResultOperator.OptionalDefaultValue,
                        queryModel.MainFromClause);

            return Expression.Call(
                entityQueryModelVisitor.LinqOperatorProvider.DefaultIfEmptyArg
                    .MakeGenericMethod(entityQueryModelVisitor.StreamedSequenceInfo.ResultItemType),
                entityQueryModelVisitor.Expression,
                optionalDefaultValue);
        }
开发者ID:aishaloshik,项目名称:EntityFramework,代码行数:25,代码来源:ResultOperatorHandler.cs

示例5: HandleContains

        private static Expression HandleContains(
            EntityQueryModelVisitor entityQueryModelVisitor,
            ContainsResultOperator containsResultOperator,
            QueryModel queryModel)
        {
            var item = entityQueryModelVisitor
                .ReplaceClauseReferences(
                    containsResultOperator.Item,
                    queryModel.MainFromClause);

            return CallWithPossibleCancellationToken(
                entityQueryModelVisitor.LinqOperatorProvider.Contains
                    .MakeGenericMethod(entityQueryModelVisitor.StreamedSequenceInfo.ResultItemType),
                entityQueryModelVisitor.Expression,
                item);
        }
开发者ID:aishaloshik,项目名称:EntityFramework,代码行数:16,代码来源:ResultOperatorHandler.cs

示例6: HandleSetOperation

        private static Expression HandleSetOperation(
            EntityQueryModelVisitor entityQueryModelVisitor,
            Expression secondSource,
            MethodInfo setMethodInfo)
        {
            var source2 = entityQueryModelVisitor
                .ReplaceClauseReferences(secondSource);

            return Expression.Call(
                setMethodInfo.MakeGenericMethod(entityQueryModelVisitor.Expression.Type.GetSequenceType()),
                entityQueryModelVisitor.Expression,
                source2);
        }
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:13,代码来源:ResultOperatorHandler.cs

示例7: HandleGroup

        private static Expression HandleGroup(
            EntityQueryModelVisitor entityQueryModelVisitor,
            GroupResultOperator groupResultOperator,
            QueryModel queryModel)
        {
            var keySelector
                = entityQueryModelVisitor
                    .ReplaceClauseReferences(
                        groupResultOperator.KeySelector,
                        queryModel.MainFromClause);

            var elementSelector
                = entityQueryModelVisitor
                    .ReplaceClauseReferences(
                        groupResultOperator.ElementSelector,
                        queryModel.MainFromClause);

            var expression
                = Expression.Call(
                    entityQueryModelVisitor.LinqOperatorProvider.GroupBy
                        .MakeGenericMethod(
                            entityQueryModelVisitor.Expression.Type.GetSequenceType(),
                            keySelector.Type,
                            elementSelector.Type),
                    entityQueryModelVisitor.Expression,
                    Expression.Lambda(keySelector, entityQueryModelVisitor.CurrentParameter),
                    Expression.Lambda(elementSelector, entityQueryModelVisitor.CurrentParameter));

            entityQueryModelVisitor.CurrentParameter
                = Expression.Parameter(expression.Type.GetSequenceType(), groupResultOperator.ItemName);

            entityQueryModelVisitor
                .AddOrUpdateMapping(groupResultOperator, entityQueryModelVisitor.CurrentParameter);

            return expression;
        }
开发者ID:RickyLin,项目名称:EntityFramework,代码行数:36,代码来源:ResultOperatorHandler.cs


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