本文整理汇总了C#中Remotion.Linq.Parsing.Structure.IntermediateModel.ClauseGenerationContext.GetContextInfo方法的典型用法代码示例。如果您正苦于以下问题:C# ClauseGenerationContext.GetContextInfo方法的具体用法?C# ClauseGenerationContext.GetContextInfo怎么用?C# ClauseGenerationContext.GetContextInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Remotion.Linq.Parsing.Structure.IntermediateModel.ClauseGenerationContext
的用法示例。
在下文中一共展示了ClauseGenerationContext.GetContextInfo方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyNodeSpecificSemantics
protected override void ApplyNodeSpecificSemantics(QueryModel queryModel, ClauseGenerationContext clauseGenerationContext)
{
var queryAnnotationResultOperator
= (QueryAnnotationResultOperator)clauseGenerationContext.GetContextInfo(Source);
((IncludeQueryAnnotation)queryAnnotationResultOperator.Annotation)
.AppendToNavigationPath(_navigationPropertyPathLambda.GetComplexPropertyAccess());
clauseGenerationContext.AddContextInfo(this, queryAnnotationResultOperator);
}
示例2: ApplyNodeSpecificSemantics
protected override QueryModel ApplyNodeSpecificSemantics(QueryModel queryModel, ClauseGenerationContext clauseGenerationContext)
{
var includeResultOperator
= (IncludeResultOperator)clauseGenerationContext.GetContextInfo(Source);
includeResultOperator.AppendToNavigationPath(_navigationPropertyPathLambda.GetComplexPropertyAccess());
clauseGenerationContext.AddContextInfo(this, includeResultOperator);
return queryModel;
}
示例3: ApplyNodeSpecificSemantics
protected override QueryModel ApplyNodeSpecificSemantics (QueryModel queryModel, ClauseGenerationContext clauseGenerationContext)
{
var previousFetchRequest = clauseGenerationContext.GetContextInfo (Source) as FetchRequestBase;
if (previousFetchRequest == null)
throw new ParserException ("ThenFetchMany must directly follow another Fetch request.");
FetchRequestBase innerFetchRequest = new FetchManyRequest (RelationMember);
innerFetchRequest = previousFetchRequest.GetOrAddInnerFetchRequest (innerFetchRequest);
clauseGenerationContext.AddContextInfo (this, innerFetchRequest);
return queryModel;
}
示例4: GetQuerySourceForNode
/// <summary>
/// Gets the <see cref="IQuerySource"/> corresponding to the given <paramref name="node"/>, throwing an <see cref="InvalidOperationException"/>
/// if no such clause has been registered in the given <paramref name="context"/>.
/// </summary>
/// <param name="node">The node for which the <see cref="IQuerySource"/> should be returned.</param>
/// <param name="context">The clause generation context.</param>
/// <returns>The <see cref="IQuerySource"/> corresponding to <paramref name="node"/>.</returns>
public static IQuerySource GetQuerySourceForNode (IQuerySourceExpressionNode node, ClauseGenerationContext context)
{
try
{
return (IQuerySource) context.GetContextInfo (node);
}
catch (KeyNotFoundException ex)
{
var message = string.Format (
"Cannot retrieve an IQuerySource for the given {0}. Be sure to call Apply before calling methods that require IQuerySources, and pass in "
+ "the same QuerySourceClauseMapping to both.",
node.GetType().Name);
throw new InvalidOperationException (message, ex);
}
}