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


C# PredicateExpression.Add方法代码示例

本文整理汇总了C#中PredicateExpression.Add方法的典型用法代码示例。如果您正苦于以下问题:C# PredicateExpression.Add方法的具体用法?C# PredicateExpression.Add怎么用?C# PredicateExpression.Add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PredicateExpression的用法示例。


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

示例1: Add

        public static void Add(int artworkId, int roleId)
        {
            var entity = new ArtworkToRoleEntity();
            entity.ArtworkId = artworkId;
            entity.RoleId = roleId;

            var filter = new PredicateExpression();
            filter.Add(ArtworkToRoleFields.ArtworkId == artworkId);
            filter.Add(ArtworkToRoleFields.RoleId == roleId);
            Database.AddOrUpdateEntity(entity, filter, false);
        }
开发者ID:MichelZ,项目名称:TVJunkie,代码行数:11,代码来源:ArtworkToRoleEntity.cs

示例2: GetTodayVisit

 public string GetTodayVisit()
 {
     WebTrackerCollection trackers = new WebTrackerCollection();
     PredicateExpression filter = new PredicateExpression();
     filter.Add(WebTrackerFields.VisitTime == DateTime.Parse(DateTime.Now.ToShortDateString()));
     trackers.GetMulti(filter);
     return trackers.Count.ToString();
 }
开发者ID:fahrigoktuna,项目名称:ProductSearchEngine,代码行数:8,代码来源:WebTrackerAdapter.cs

示例3: FilterValidEntities

        /// <summary>
        /// Returns entites which validityDateTimeField is GREATER OR EQUAL than startDateTime,
        /// and LESS than endDateTime.
        public static PredicateExpression FilterValidEntities(DateTime? startDateTime,
            DateTime? endDateTime,
            EntityField2 validityDateTimeField)
        {
            PredicateExpression predicateExpression = new PredicateExpression();

            if (null != startDateTime)
            {
                predicateExpression.Add(validityDateTimeField >= startDateTime.Value);
            }

            if (null != endDateTime)
            {
                predicateExpression.Add(validityDateTimeField < endDateTime.Value);
            }

            return predicateExpression;
        }
开发者ID:malininja,项目名称:NinjaSoftware.Helpers,代码行数:21,代码来源:PredicateHelper.cs

示例4: GetMainCategories

        public CategoryCollection GetMainCategories()
        {
            CategoryCollection categories = new CategoryCollection();
            PredicateExpression filter = new PredicateExpression();
            filter.Add(new FieldCompareNullPredicate(CategoryFields.BaseCategoryId));
            categories.GetMulti(filter);

            return categories;
        }
开发者ID:fahrigoktuna,项目名称:ProductSearchEngine,代码行数:9,代码来源:CategoryAdapter.cs

示例5: GetMultiUsingRolesWithAuditAction

 /// <summary>Retrieves in the calling AuditActionCollection object all AuditActionEntity objects which are related via a relation of type 'm:n' with the passed in RoleEntity.</summary>
 /// <param name="containingTransaction">A containing transaction, if caller is added to a transaction, or null if not.</param>
 /// <param name="collectionToFill">Collection to fill with the entity objects retrieved</param>
 /// <param name="maxNumberOfItemsToReturn"> The maximum number of items to return with this retrieval query. When set to 0, no limitations are specified.</param>
 /// <param name="sortClauses">The order by specifications for the sorting of the resultset. When not specified, no sorting is applied.</param>
 /// <param name="entityFactoryToUse">The EntityFactory to use when creating entity objects during a GetMulti() call.</param>
 /// <param name="roleInstance">RoleEntity object to be used as a filter in the m:n relation</param>
 /// <param name="prefetchPathToUse">the PrefetchPath which defines the graph of objects to fetch.</param>
 /// <param name="pageNumber">The page number to retrieve.</param>
 /// <param name="pageSize">The page size of the page to retrieve.</param>
 /// <returns>true if succeeded, false otherwise</returns>
 public bool GetMultiUsingRolesWithAuditAction(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity roleInstance, IPrefetchPath prefetchPathToUse, int pageNumber, int pageSize)
 {
     RelationCollection relations = new RelationCollection();
     relations.Add(AuditActionEntity.Relations.RoleAuditActionEntityUsingAuditActionID, "RoleAuditAction_");
     relations.Add(RoleAuditActionEntity.Relations.RoleEntityUsingRoleID, "RoleAuditAction_", string.Empty, JoinHint.None);
     IPredicateExpression selectFilter = new PredicateExpression();
     selectFilter.Add(new FieldCompareValuePredicate(roleInstance.Fields[(int)RoleFieldIndex.RoleID], ComparisonOperator.Equal));
     return this.GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse, pageNumber, pageSize);
 }
开发者ID:priaonehaha,项目名称:HnD,代码行数:20,代码来源:AuditActionDAO.cs

示例6: CreatePredicate

        public IPredicateExpression CreatePredicate(ConcurrencyPredicateType predicateTypeToCreate, object containingEntity)
        {
            IPredicateExpression toReturn = null;

            if ((_doTriggerOnSave && predicateTypeToCreate == ConcurrencyPredicateType.Save) ||
                (_doTriggerOnDelete && predicateTypeToCreate == ConcurrencyPredicateType.Delete))
            {
                toReturn = new PredicateExpression();
                IEntity2 entity = (IEntity2)containingEntity;
                EntityField2 concurrencyField = (EntityField2)entity.Fields[_concurrencyFieldName];
                toReturn.Add(concurrencyField == concurrencyField.CurrentValue);
            }

            return toReturn;
        }
开发者ID:malininja,项目名称:NinjaSoftware.Helpers,代码行数:15,代码来源:OptimisticConcurrencyPredicateFactory.cs


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