本文整理汇总了C#中RavenJToken.SelectTokenWithRavenSyntaxReturningFlatStructure方法的典型用法代码示例。如果您正苦于以下问题:C# RavenJToken.SelectTokenWithRavenSyntaxReturningFlatStructure方法的具体用法?C# RavenJToken.SelectTokenWithRavenSyntaxReturningFlatStructure怎么用?C# RavenJToken.SelectTokenWithRavenSyntaxReturningFlatStructure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RavenJToken
的用法示例。
在下文中一共展示了RavenJToken.SelectTokenWithRavenSyntaxReturningFlatStructure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MatchFilters
public virtual bool MatchFilters(RavenJToken item)
{
foreach (var filter in Filters)
{
bool anyRecords = false;
bool matchedFilter = false;
foreach (var tuple in item.SelectTokenWithRavenSyntaxReturningFlatStructure(filter.Path))
{
if (tuple == null || tuple.Item1 == null)
continue;
anyRecords = true;
var val = tuple.Item1.Type == JTokenType.String
? tuple.Item1.Value<string>()
: tuple.Item1.ToString(Formatting.None);
matchedFilter |= filter.Values.Any(value => String.Equals(val, value, StringComparison.OrdinalIgnoreCase)) ==
filter.ShouldMatch;
}
if (filter.ShouldMatch == false && anyRecords == false) // RDBQA-7
return true;
if (matchedFilter == false)
return false;
}
return true;
}
示例2: MatchFilters
public virtual bool MatchFilters(RavenJToken item)
{
foreach (var filter in Filters)
{
var copy = filter;
foreach (var tuple in item.SelectTokenWithRavenSyntaxReturningFlatStructure(copy.Key))
{
if (tuple == null || tuple.Item1 == null)
continue;
var val = tuple.Item1.Type == JTokenType.String
? tuple.Item1.Value<string>()
: tuple.Item1.ToString(Formatting.None);
if (String.Equals(val, filter.Value, StringComparison.InvariantCultureIgnoreCase) == false)
return false;
}
}
return true;
}