本文整理汇总了C#中Microsoft.OData.Core.UriParser.Semantic.SelectExpandClause.Traverse方法的典型用法代码示例。如果您正苦于以下问题:C# SelectExpandClause.Traverse方法的具体用法?C# SelectExpandClause.Traverse怎么用?C# SelectExpandClause.Traverse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.OData.Core.UriParser.Semantic.SelectExpandClause
的用法示例。
在下文中一共展示了SelectExpandClause.Traverse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateSelectExpandContextUriSegment
/// <summary>
/// Build the expand clause for a given level in the selectExpandClause
/// </summary>
/// <param name="selectExpandClause">the current level select expand clause</param>
/// <returns>the select and expand segment for context url in this level.</returns>
private static string CreateSelectExpandContextUriSegment(SelectExpandClause selectExpandClause)
{
if (selectExpandClause != null)
{
string contextUri;
selectExpandClause.Traverse(ProcessSubExpand, CombineSelectAndExpandResult, out contextUri);
if (!string.IsNullOrEmpty(contextUri))
{
return ODataConstants.ContextUriProjectionStart + contextUri + ODataConstants.ContextUriProjectionEnd;
}
}
return string.Empty;
}
示例2: CreateFromSelectExpandClause
/// <summary>Create SelectedPropertiesNode from SelectExpandClause.</summary>
/// <param name="selectExpandClause">The SelectExpandClause representing $select and $expand clauses.</param>
/// <returns>SelectedPropertiesNode generated using <paramref name="selectExpandClause"/></returns>
private static SelectedPropertiesNode CreateFromSelectExpandClause(SelectExpandClause selectExpandClause)
{
SelectedPropertiesNode node;
selectExpandClause.Traverse(ProcessSubExpand, CombineSelectAndExpandResult, out node);
return node;
}