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


C# IASTNode.Where方法代码示例

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


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

示例1: Visit

 public void Visit(IASTNode node)
 {
     if (node.Type == HqlSqlWalker.FROM)
     {
         _nodes.AddRange(node.Where(child => child.Type == HqlSqlWalker.RANGE).Select(range => range.GetChild(0)));
     }
 }
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:7,代码来源:QuerySourceDetector.cs

示例2: AddImpliedFromToQuery

		/// <summary>
		/// Handles HQL AST transformation for collection filters (which are created with <see cref="ISession.CreateFilter"/>).
		/// 
		/// Adds FROM elements to implicit FROM clause.
		/// E.g., 
		/// <code>
		/// ( query ( SELECT_FROM {filter-implied FROM} ) ( where ( = X 10 ) ) )
		/// </code>
		/// gets converted to 
		/// <code>
		/// ( query ( SELECT_FROM ( FROM NHibernate.DomainModel.Many this ) ) ( where ( = X 10 ) ) )
		/// </code>
		/// </summary>
		/// <param name="ast">The root node of HQL query</param>
		/// <param name="collectionRole">Collection that is being filtered</param>
		/// <param name="factory">Session factory</param>
		internal static void AddImpliedFromToQuery(IASTNode ast, string collectionRole, ISessionFactoryImplementor factory)
		{
			if (ast.Type != HqlParser.QUERY)
			{
				var msg = string.Format(CultureInfo.InvariantCulture,
					"invalid query type for collection filtering: expected {0}, got {1}", HqlParser.tokenNames[HqlParser.QUERY], HqlParser.tokenNames[ast.Type]);
				throw new QueryException(msg);
			}
			var selectFromClause = ast.Where(x => x.Type == HqlParser.SELECT_FROM).Single();
			var fromClause = selectFromClause.Where(x => x.Type == HqlParser.FROM).Single();
			
			fromClause.Text = "FROM"; // Just for prettier debug output
			AddImpliedFromToFromNode(fromClause, collectionRole, factory);
		}
开发者ID:marchlud,项目名称:nhibernate-core,代码行数:30,代码来源:HqlFilterPreprocessor.cs


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