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


C# ClauseGenerationContext.GetContextInfo方法代码示例

本文整理汇总了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);
        }
开发者ID:491134648,项目名称:EntityFramework,代码行数:10,代码来源:ThenIncludeExpressionNode.cs

示例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;
        }
开发者ID:thegido,项目名称:EntityFramework,代码行数:11,代码来源:ThenIncludeExpressionNode.cs

示例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;
    }
开发者ID:GTuritto,项目名称:BrightstarDB,代码行数:12,代码来源:ThenFetchManyExpressionNode.cs

示例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);
   }
 }
开发者ID:GTuritto,项目名称:BrightstarDB,代码行数:22,代码来源:QuerySourceExpressionNodeUtility.cs


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