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


C# IPredicate.Includes方法代码示例

本文整理汇总了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;
        }
开发者ID:PetersonDave,项目名称:Unicorn,代码行数:8,代码来源:SerializationHelper.cs

示例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));
			}
		}
开发者ID:hbopuri,项目名称:Unicorn,代码行数:17,代码来源:RemotingService.cs

示例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;
        }
开发者ID:PetersonDave,项目名称:Unicorn,代码行数:21,代码来源:UnicornDataProviderTests.cs


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