本文整理汇总了C#中IPredicate.Includes方法的典型用法代码示例。如果您正苦于以下问题:C# IPredicate.Includes方法的具体用法?C# IPredicate.Includes怎么用?C# IPredicate.Includes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPredicate
的用法示例。
在下文中一共展示了IPredicate.Includes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DumpItemInternal
protected virtual PredicateResult DumpItemInternal(IItemData item, IPredicate predicate, ITargetDataStore targetDataStore)
{
var predicateResult = predicate.Includes(item);
if (!predicateResult.IsIncluded) return predicateResult;
targetDataStore.Save(item);
return predicateResult;
}
示例2: Serialize
private void Serialize(ISourceItem root, IPredicate predicate, ISerializationProvider serializationProvider, ILogger logger)
{
var predicateResult = predicate.Includes(root);
if (predicateResult.IsIncluded)
{
serializationProvider.SerializeItem(root);
foreach (var child in root.Children)
{
Serialize(child, predicate, serializationProvider, logger);
}
}
else
{
logger.Warn("[S] {0} because {1}".FormatWith(root.DisplayIdentifier, predicateResult.Justification));
}
}
示例3: CreateTestProvider
// TODO
private UnicornDataProvider CreateTestProvider(Database db, ITargetDataStore targetDataStore = null, ISourceDataStore sourceDataStore = null, IPredicate predicate = null, IFieldFilter filter = null, IUnicornDataProviderLogger logger = null, bool enableTransparentSync = false)
{
if (predicate == null)
{
predicate = Substitute.For<IPredicate>();
predicate.Includes(Arg.Any<IItemData>()).Returns(new PredicateResult(true));
}
if (filter == null)
{
filter = Substitute.For<IFieldFilter>();
filter.Includes(Arg.Any<Guid>()).Returns(true);
}
var dp = new UnicornDataProvider(targetDataStore ?? Substitute.For<ITargetDataStore>(), sourceDataStore ?? Substitute.For<ISourceDataStore>(), predicate, filter, logger ?? Substitute.For<IUnicornDataProviderLogger>(), new DefaultUnicornDataProviderConfiguration(enableTransparentSync));
dp.ParentDataProvider = db.GetDataProviders().First();
return dp;
}