本文整理汇总了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));
}
示例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));
}
示例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));
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}