• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IPredicate类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: Triple

        internal Triple(ISubject s, IPredicate p, IObject o)
        {
            _s = s;
              _p = p;
              _o = o;

              _s.Value = CleanValue(_s.Value);
              _p.Value = CleanValue(_p.Value);
              _o.Value = CleanValue(_o.Value);
        }
开发者ID:klod68,项目名称:simpletriplestore,代码行数:10,代码来源:Triple.cs


示例17: Delete

        public string Delete(IClassMapper classMap, IPredicate predicate, IDictionary<string, object> parameters)
        {
            StringBuilder sql = new StringBuilder(string.Format("DELETE FROM {0}", GetTableName(classMap)));
            if (predicate != null)
            {
                sql.Append(" WHERE ")
                    .Append(predicate.GetSql(parameters));
            }

            return sql.ToString();
        }
开发者ID:kenchilada,项目名称:Dapper-Extensions,代码行数:11,代码来源:SqlGenerator.cs


示例18: ConditionalRule

 /// <summary>
 /// Creates a <see cref="ConditionalRule"/> with a 
 /// <see cref="IPredicate"/> instance and 
 /// <see cref="IRule"/> instance. If the predicate returns
 /// false, <paramref name="elseRule"/> is executed.
 /// </summary>
 /// <param name="predicate">
 /// <see cref="IPredicate"/> instance used for testing
 /// </param>
 /// <param name="rule">
 /// rule to execute.
 /// </param>
 /// <param name="elseRule">
 /// rule to execute if predicate is false.
 /// </param>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="predicate"/> or <paramref name="rule"/>
 /// is a null reference.
 /// </exception>
 public ConditionalRule(IPredicate predicate, IRule rule, IRule elseRule)
     : base(false)
 {
     if (predicate==null)
         throw new ArgumentNullException("predicate");
     this.predicate=predicate;
     if (rule==null)
         throw new ArgumentNullException("rule");
     this.rule=rule;
     this.elseRule=elseRule;
 }
开发者ID:BackupTheBerlios,项目名称:mbunit-svn,代码行数:30,代码来源:ConditionalRule.cs


示例19: UnicornDataProvider

        public UnicornDataProvider(ISerializationProvider serializationProvider, IPredicate predicate, IFieldPredicate fieldPredicate, IUnicornDataProviderLogger logger)
        {
            Assert.ArgumentNotNull(serializationProvider, "serializationProvider");
            Assert.ArgumentNotNull(predicate, "predicate");
            Assert.ArgumentNotNull(fieldPredicate, "fieldPredicate");
            Assert.ArgumentNotNull(logger, "logger");

            _logger = logger;
            _predicate = predicate;
            _fieldPredicate = fieldPredicate;
            _serializationProvider = serializationProvider;
        }
开发者ID:BerserkerDotNet,项目名称:Unicorn,代码行数:12,代码来源:UnicornDataProvider.cs


示例20: GetDailys

        /// <summary>
        /// 获取日消费清单
        /// </summary>
        /// <param name="start"></param>
        /// <param name="end"></param>
        /// <returns></returns>
        public IEnumerable<Daily> GetDailys(DateTime start, DateTime end)
        {
            IPredicate[] predicates = new IPredicate[]
            {
                Predicates.Field<Daily>(x => x.Date, Operator.Ge, start),
                Predicates.Field<Daily>(x => x.Date, Operator.Lt, new DateTime(end.Year, end.Month, end.Day).AddDays(1))
            };
            IList<ISort> sorts = new List<ISort>()
            {
                Predicates.Sort<Daily>(x => x.Date)
            };

            return _database.GetList<Daily>(Predicates.Group(GroupOperator.And, predicates), sorts);
        }
开发者ID:KINGGUOKUN,项目名称:Account,代码行数:20,代码来源:DailyDAL.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IPredicateExpression类代码示例发布时间:2022-05-24
下一篇:
C# IPrecisionModel类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap