本文整理汇总了C#中EntityQueryModelVisitor.CreateScope方法的典型用法代码示例。如果您正苦于以下问题:C# EntityQueryModelVisitor.CreateScope方法的具体用法?C# EntityQueryModelVisitor.CreateScope怎么用?C# EntityQueryModelVisitor.CreateScope使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntityQueryModelVisitor
的用法示例。
在下文中一共展示了EntityQueryModelVisitor.CreateScope方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}
示例2: 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));
}
示例3: 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(typeof(QuerySourceScope)),
entityQueryModelVisitor.CreateScope(
entityQueryModelVisitor.Expression,
entityQueryModelVisitor.StreamedSequenceInfo.ResultItemType,
queryModel.MainFromClause),
optionalDefaultValue);
}