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


C# IPredicate类代码示例

本文整理汇总了C#中IPredicate的典型用法代码示例。如果您正苦于以下问题:C# IPredicate类的具体用法?C# IPredicate怎么用?C# IPredicate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: UnicornDataProvider

        public UnicornDataProvider(ITargetDataStore targetDataStore, ISourceDataStore sourceDataStore, IPredicate predicate, IFieldFilter fieldFilter, IUnicornDataProviderLogger logger, IUnicornDataProviderConfiguration dataProviderConfiguration, ISyncConfiguration syncConfiguration, PredicateRootPathResolver rootPathResolver)
        {
            Assert.ArgumentNotNull(targetDataStore, nameof(targetDataStore));
            Assert.ArgumentNotNull(predicate, nameof(predicate));
            Assert.ArgumentNotNull(fieldFilter, nameof(fieldFilter));
            Assert.ArgumentNotNull(logger, nameof(logger));
            Assert.ArgumentNotNull(sourceDataStore, nameof(sourceDataStore));
            Assert.ArgumentNotNull(dataProviderConfiguration, nameof(dataProviderConfiguration));
            Assert.ArgumentNotNull(rootPathResolver, nameof(rootPathResolver));
            Assert.ArgumentNotNull(syncConfiguration, nameof(syncConfiguration));

            _logger = logger;
            _dataProviderConfiguration = dataProviderConfiguration;
            _syncConfiguration = syncConfiguration;
            _rootPathResolver = rootPathResolver;
            _predicate = predicate;
            _fieldFilter = fieldFilter;
            _targetDataStore = targetDataStore;
            _sourceDataStore = sourceDataStore;

            // enable capturing recycle bin and archive restores to serialize the target item if included
            EventManager.Subscribe<RestoreItemCompletedEvent>(HandleItemRestored);

            try
            {
                _targetDataStore.RegisterForChanges(RemoveItemFromCaches);
            }
            catch (NotImplementedException)
            {
                // if the data store doesn't implement watching, cool story bruv
            }
        }
开发者ID:GlennHaworth,项目名称:Unicorn,代码行数:32,代码来源:UnicornDataProvider.cs

示例2: PredicateRootPathResolver

 public PredicateRootPathResolver(IPredicate predicate, ISerializationProvider serializationProvider, ISourceDataProvider sourceDataProvider, ILogger logger)
 {
     _predicate = predicate;
     _serializationProvider = serializationProvider;
     _sourceDataProvider = sourceDataProvider;
     _logger = logger;
 }
开发者ID:BerserkerDotNet,项目名称:Unicorn,代码行数:7,代码来源:PredicateRootPathResolver.cs

示例3: AtomFunction

 /// <summary>
 /// Private constructor used for cloning.
 /// </summary>
 /// <param name="source">The source AtomFunction to use for building the new one.</param>
 /// <param name="members">The members to use in the new AtomFunction.</param>
 private AtomFunction(AtomFunction source, IPredicate[] members)
     : base(source, members)
 {
     this.bob = source.bob;
     this.functionSignature = source.functionSignature;
     this.resolutionType = source.resolutionType;
 }
开发者ID:plamikcho,项目名称:xbrlpoc,代码行数:12,代码来源:AtomFunction.cs

示例4: SelectSet

        public string SelectSet(IClassMapper classMap, IPredicate predicate, IList<ISort> sort, int firstResult, int maxResults, IDictionary<string, object> parameters)
        {
            if (sort == null || !sort.Any())
            {
                throw new ArgumentNullException("Sort", "Sort cannot be null or empty.");
            }

            if (parameters == null)
            {
                throw new ArgumentNullException("Parameters");
            }

            StringBuilder innerSql = new StringBuilder(string.Format("SELECT {0} FROM {1}",
                BuildSelectColumns(classMap),
                GetTableName(classMap)));
            if (predicate != null)
            {
                innerSql.Append(" WHERE ")
                    .Append(predicate.GetSql(this, parameters));
            }

            string orderBy = sort.Select(s => GetColumnName(classMap, s.PropertyName, false) + (s.Ascending ? " ASC" : " DESC")).AppendStrings();
            innerSql.Append(" ORDER BY " + orderBy);

            string sql = Configuration.Dialect.GetSetSql(innerSql.ToString(), firstResult, maxResults, parameters);
            return sql;
        }
开发者ID:FlowWithCaptainJack,项目名称:Dapper.Extensions.Linq,代码行数:27,代码来源:SqlGeneratorImpl.cs

示例5: ConfigurationDetails

 public ConfigurationDetails(IPredicate predicate, ISerializationProvider serializationProvider, ISourceDataProvider sourceDataProvider, IEvaluator evaluator)
 {
     _predicate = predicate;
     _serializationProvider = serializationProvider;
     _sourceDataProvider = sourceDataProvider;
     _evaluator = evaluator;
 }
开发者ID:kalpesh0082,项目名称:Unicorn,代码行数:7,代码来源:ConfigurationDetails.cs

示例6: UnicornDataProvider

        public UnicornDataProvider(ITargetDataStore targetDataStore, ISourceDataStore sourceDataStore, IPredicate predicate, IFieldFilter fieldFilter, IUnicornDataProviderLogger logger, IUnicornDataProviderConfiguration configuration)
        {
            Assert.ArgumentNotNull(targetDataStore, "serializationProvider");
            Assert.ArgumentNotNull(predicate, "predicate");
            Assert.ArgumentNotNull(fieldFilter, "fieldPredicate");
            Assert.ArgumentNotNull(logger, "logger");
            Assert.ArgumentNotNull(sourceDataStore, "sourceDataStore");
            Assert.ArgumentNotNull(configuration, "configuration");

            _logger = logger;
            _configuration = configuration;
            _predicate = predicate;
            _fieldFilter = fieldFilter;
            _targetDataStore = targetDataStore;
            _sourceDataStore = sourceDataStore;

            try
            {
                _targetDataStore.RegisterForChanges(RemoveItemFromCaches);
            }
            catch (NotImplementedException)
            {
                // if the data store doesn't implement watching, cool story bruv
            }
        }
开发者ID:PetersonDave,项目名称:Unicorn,代码行数:25,代码来源:UnicornDataProvider.cs

示例7: PredicateRootPathResolver

		public PredicateRootPathResolver(IPredicate predicate, ITargetDataStore targetDataStore, ISourceDataStore sourceDataStore, ILogger logger)
		{
			_predicate = predicate;
			_targetDataStore = targetDataStore;
			_sourceDataStore = sourceDataStore;
			_logger = logger;
		}
开发者ID:GlennHaworth,项目名称:Unicorn,代码行数:7,代码来源:PredicateRootPathResolver.cs

示例8: FiatSitecoreSerializationProvider

        public FiatSitecoreSerializationProvider(IPredicate predicate, IFieldPredicate fieldPredicate, IFiatDeserializerLogger logger, string rootPath = null, string logName = "UnicornItemSerialization")
            : base(predicate, rootPath, logName)
        {
            Assert.ArgumentNotNull(logger, "logger");

            _deserializer = new FiatDeserializer(logger, fieldPredicate);
        }
开发者ID:kalpesh0082,项目名称:Unicorn,代码行数:7,代码来源:FiatSitecoreSerializationProvider.cs

示例9: Populate

		/// <summary>
		/// Populates the Variable predicates of a target Atom, using another Atom as a template
		/// and a Fact as the source of data, i.e. Individual predicates.
		/// </summary>
		/// <param name="data">The data for populating the Atom.</param>
		/// <param name="template">The template of Atom being populated.</param>
		/// <param name="target">The members to populate.</param>
		public static void Populate(Fact data, Atom template, IPredicate[] members) {
			for(int i=0;i<members.Length;i++)
				if (members[i] is Variable) {
					int j = Array.IndexOf(template.Members, members[i]);
					if (j >= 0) members[i] = data.Members[j];
				}
		}
开发者ID:killbug2004,项目名称:WSProf,代码行数:14,代码来源:Fact.cs

示例10: PredicateFilteredItemData

        public PredicateFilteredItemData(IItemData innerItem, IPredicate predicate)
            : base(innerItem)
        {
            Assert.ArgumentNotNull(predicate, "predicate");

            _predicate = predicate;
        }
开发者ID:bllue78,项目名称:Unicorn,代码行数:7,代码来源:PredicateFilteredItemData.cs

示例11: FiatRemotedSerializationProvider

		public FiatRemotedSerializationProvider(IPredicate predicate, IFieldPredicate fieldPredicate, IFiatDeserializerLogger logger, string remoteUrl = null, string rootPath = null, string logName = "UnicornItemSerialization")
			: base(predicate, fieldPredicate, logger, rootPath, logName)
		{
			Assert.ArgumentNotNull(remoteUrl, "remoteUrl");

			RemoteUrl = remoteUrl;
		}
开发者ID:GlennHaworth,项目名称:Unicorn,代码行数:7,代码来源:FiatRemotedSerializationProvider.cs

示例12: ConfigurationDetails

 public ConfigurationDetails(IPredicate predicate, ITargetDataStore serializationStore, ISourceDataStore sourceDataStore, IEvaluator evaluator)
 {
     _predicate = predicate;
     _serializationStore = serializationStore;
     _sourceDataStore = sourceDataStore;
     _evaluator = evaluator;
 }
开发者ID:PetersonDave,项目名称:Unicorn,代码行数:7,代码来源:ConfigurationDetails.cs

示例13: 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 = CreateInclusiveTestPredicate();
			}

			if (filter == null)
			{
				filter = Substitute.For<IFieldFilter>();
				filter.Includes(Arg.Any<Guid>()).Returns(true);
			}

			targetDataStore = targetDataStore ?? Substitute.For<ITargetDataStore>();
			sourceDataStore = sourceDataStore ?? Substitute.For<ISourceDataStore>();

			var dp = new UnicornDataProvider(targetDataStore, 
				sourceDataStore, 
				predicate, 
				filter, 
				logger ?? Substitute.For<IUnicornDataProviderLogger>(), 
				new DefaultUnicornDataProviderConfiguration(enableTransparentSync), 
				new PredicateRootPathResolver(predicate, targetDataStore, sourceDataStore, Substitute.For<ILogger>()));
			
			dp.ParentDataProvider = db.GetDataProviders().First();

			return dp;
		}
开发者ID:hbopuri,项目名称:Unicorn,代码行数:30,代码来源:UnicornDataProviderTests.cs

示例14: ConfigurationDetails

		public ConfigurationDetails(IPredicate predicate, ITargetDataStore serializationStore, ISourceDataStore sourceDataStore, IEvaluator evaluator, ConfigurationDependencyResolver dependencyResolver)
		{
			_predicate = predicate;
			_serializationStore = serializationStore;
			_sourceDataStore = sourceDataStore;
			_evaluator = evaluator;
			_dependencyResolver = dependencyResolver;
		}
开发者ID:hbopuri,项目名称:Unicorn,代码行数:8,代码来源:ConfigurationDetails.cs

示例15: Slot

        /// <summary>
        /// Instantiates a new slot that will hold a named predicate.
        /// </summary>
        /// <param name="name">The name of the predicate</param>
        /// <param name="predicate">The predicate itself</param>
        public Slot(string name, IPredicate predicate)
        {
            if ((name == null) || (name == String.Empty)) throw new ArgumentException("The name of a slot can not be null or empty");
            if (predicate == null) throw new ArgumentException("The predicate of a slot can not be null");
            if (predicate is Slot) throw new ArgumentException("A slot can not contain another slot");

            this.name = name;
            this.predicate = predicate;
        }
开发者ID:Ghasan,项目名称:NxBRE,代码行数:14,代码来源:Slot.cs


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