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


C# RelationCollection.Add方法代码示例

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


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

示例1: 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

示例2: GetRelationsForField

        /// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
        /// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
        /// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
        public static RelationCollection GetRelationsForField(string fieldName)
        {
            RelationCollection toReturn = new RelationCollection();
            switch(fieldName)
            {

                case "Muser":
                    toReturn.Add(MHakAksesEntity.Relations.MUserEntityUsingCIdHakAkses);
                    break;

                default:

                    break;
            }
            return toReturn;
        }
开发者ID:trogalko,项目名称:kalibrasi,代码行数:19,代码来源:MHakAksesEntity.cs

示例3: GetRelationsForField

 /// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
 /// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
 /// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
 internal static RelationCollection GetRelationsForField(string fieldName)
 {
     RelationCollection toReturn = new RelationCollection();
     switch(fieldName)
     {
         case "AspnetUser":
             toReturn.Add(Relations.AspnetUsersEntityUsingUserId);
             break;
         default:
             break;
     }
     return toReturn;
 }
开发者ID:MonoSoftware,项目名称:MonoX-Data-Access-Layer,代码行数:16,代码来源:AuditInfoEntity.cs

示例4: GetRelationsForField

		/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
		/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
		/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
		internal static RelationCollection GetRelationsForField(string fieldName)
		{
			RelationCollection toReturn = new RelationCollection();
			switch(fieldName)
			{
				case "SalesPerson":
					toReturn.Add(Relations.SalesPersonEntityUsingSalesPersonId);
					break;
				default:
					break;				
			}
			return toReturn;
		}
开发者ID:tdhung80,项目名称:RawDataAccessBencher,代码行数:16,代码来源:SalesPersonQuotaHistoryEntity.cs

示例5: GetRelationsForField

		/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
		/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
		/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
		internal static RelationCollection GetRelationsForField(string fieldName)
		{
			RelationCollection toReturn = new RelationCollection();
			switch(fieldName)
			{
				case "Address":
					toReturn.Add(Relations.AddressEntityUsingAddressId);
					break;
				case "AddressType":
					toReturn.Add(Relations.AddressTypeEntityUsingAddressTypeId);
					break;
				case "BusinessEntity":
					toReturn.Add(Relations.BusinessEntityEntityUsingBusinessEntityId);
					break;
				default:
					break;				
			}
			return toReturn;
		}
开发者ID:ck-lee,项目名称:RawDataAccessBencher,代码行数:22,代码来源:BusinessEntityAddressEntity.cs

示例6: GetRelationsForField

 /// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
 /// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
 /// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
 internal static RelationCollection GetRelationsForField(string fieldName)
 {
     RelationCollection toReturn = new RelationCollection();
     switch(fieldName)
     {
         case "AspnetApplications":
             toReturn.Add(Relations.AspnetApplicationsEntityUsingApplicationId);
             break;
         case "NewsCategoryParent":
             toReturn.Add(Relations.NewsCategoryEntityUsingIdNewsCategoryId);
             break;
         case "NewsCategoryChildrens":
             toReturn.Add(Relations.NewsCategoryEntityUsingNewsCategoryId);
             break;
         case "NewsCategoryInRoles":
             toReturn.Add(Relations.NewsCategoryInRoleEntityUsingNewsCategoryId);
             break;
         case "NewsCategoryLocalizations":
             toReturn.Add(Relations.NewsCategoryLocalizationEntityUsingNewsCategoryId);
             break;
         case "NewsItems":
             toReturn.Add(Relations.NewsItemEntityUsingNewsCategoryId);
             break;
         case "SnRelationshipss":
             toReturn.Add(Relations.SnRelationshipEntityUsingNewsCategoryId);
             break;
         case "NewsCategoryTemplate":
             toReturn.Add(Relations.NewsCategoryTemplateEntityUsingId);
             break;
         default:
             break;
     }
     return toReturn;
 }
开发者ID:MonoSoftware,项目名称:MonoX-Data-Access-Layer,代码行数:37,代码来源:NewsCategoryEntity.cs

示例7: GetRelationsForField

		/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
		/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
		/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
		internal static RelationCollection GetRelationsForField(string fieldName)
		{
			RelationCollection toReturn = new RelationCollection();
			switch(fieldName)
			{
				case "Contact":
					toReturn.Add(Relations.ContactEntityUsingContactId);
					break;
				case "Employee":
					toReturn.Add(Relations.EmployeeEntityUsingEmployeeIdManagerId);
					break;
				case "Employees":
					toReturn.Add(Relations.EmployeeEntityUsingManagerId);
					break;
				case "EmployeeAddresses":
					toReturn.Add(Relations.EmployeeAddressEntityUsingEmployeeId);
					break;
				case "EmployeeDepartmentHistories":
					toReturn.Add(Relations.EmployeeDepartmentHistoryEntityUsingEmployeeId);
					break;
				case "EmployeePayHistories":
					toReturn.Add(Relations.EmployeePayHistoryEntityUsingEmployeeId);
					break;
				case "JobCandidates":
					toReturn.Add(Relations.JobCandidateEntityUsingEmployeeId);
					break;
				case "PurchaseOrderHeaders":
					toReturn.Add(Relations.PurchaseOrderHeaderEntityUsingEmployeeId);
					break;
				case "SalesPerson":
					toReturn.Add(Relations.SalesPersonEntityUsingSalesPersonId);
					break;
				default:
					break;				
			}
			return toReturn;
		}
开发者ID:perbrage,项目名称:RawDataAccessBencher,代码行数:40,代码来源:EmployeeEntity.cs

示例8: GetMultiUsingUserCollectionViaDonor_

 /// <summary>
 /// Retrieves in the calling AccountCollection object all AccountEntity objects
 /// which are related via a relation of type 'm:n' with the passed in UserEntity. 
 /// </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. 
 /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. 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="userInstance">UserEntity 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>
 /// <returns>true if succeeded, false otherwise</returns>
 public bool GetMultiUsingUserCollectionViaDonor_(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity userInstance, IPrefetchPath prefetchPathToUse)
 {
     IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(Auction.Entities.EntityType.AccountEntity);
     RelationCollection relations = new RelationCollection();
     relations.Add(AccountEntity.Relations.DonorEntityUsingAccountId, "Donor_");
     relations.Add(DonorEntity.Relations.UserEntityUsingUpdatedBy, "Donor_", string.Empty, JoinHint.None);
     IPredicateExpression selectFilter = new PredicateExpression();
     selectFilter.Add(new FieldCompareValuePredicate(userInstance.Fields[(int)UserFieldIndex.Id], ComparisonOperator.Equal));
     return GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, prefetchPathToUse);
 }
开发者ID:danappleyard,项目名称:auction-csharp,代码行数:23,代码来源:AccountDAO.cs

示例9: GetRelationsForField

		/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
		/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
		/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
		internal static RelationCollection GetRelationsForField(string fieldName)
		{
			RelationCollection toReturn = new RelationCollection();
			switch(fieldName)
			{
				case "ProductModel":
					toReturn.Add(Relations.ProductModelEntityUsingProductModelId);
					break;
				case "ProductSubcategory":
					toReturn.Add(Relations.ProductSubcategoryEntityUsingProductSubcategoryId);
					break;
				case "UnitMeasure":
					toReturn.Add(Relations.UnitMeasureEntityUsingSizeUnitMeasureCode);
					break;
				case "UnitMeasure_":
					toReturn.Add(Relations.UnitMeasureEntityUsingWeightUnitMeasureCode);
					break;
				case "BillOfMaterials":
					toReturn.Add(Relations.BillOfMaterialEntityUsingComponentId);
					break;
				case "BillOfMaterials_":
					toReturn.Add(Relations.BillOfMaterialEntityUsingProductAssemblyId);
					break;
				case "ProductCostHistories":
					toReturn.Add(Relations.ProductCostHistoryEntityUsingProductId);
					break;
				case "ProductDocuments":
					toReturn.Add(Relations.ProductDocumentEntityUsingProductId);
					break;
				case "ProductInventories":
					toReturn.Add(Relations.ProductInventoryEntityUsingProductId);
					break;
				case "ProductListPriceHistories":
					toReturn.Add(Relations.ProductListPriceHistoryEntityUsingProductId);
					break;
				case "ProductProductPhotos":
					toReturn.Add(Relations.ProductProductPhotoEntityUsingProductId);
					break;
				case "ProductReviews":
					toReturn.Add(Relations.ProductReviewEntityUsingProductId);
					break;
				case "ProductVendors":
					toReturn.Add(Relations.ProductVendorEntityUsingProductId);
					break;
				case "PurchaseOrderDetails":
					toReturn.Add(Relations.PurchaseOrderDetailEntityUsingProductId);
					break;
				case "ShoppingCartItems":
					toReturn.Add(Relations.ShoppingCartItemEntityUsingProductId);
					break;
				case "SpecialOfferProducts":
					toReturn.Add(Relations.SpecialOfferProductEntityUsingProductId);
					break;
				case "TransactionHistories":
					toReturn.Add(Relations.TransactionHistoryEntityUsingProductId);
					break;
				case "WorkOrders":
					toReturn.Add(Relations.WorkOrderEntityUsingProductId);
					break;
				default:
					break;				
			}
			return toReturn;
		}
开发者ID:ck-lee,项目名称:RawDataAccessBencher,代码行数:67,代码来源:ProductEntity.cs

示例10: GetRelationsForField

 /// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
 /// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
 /// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
 internal static RelationCollection GetRelationsForField(string fieldName)
 {
     RelationCollection toReturn = new RelationCollection();
     switch(fieldName)
     {
         case "Person":
             toReturn.Add(Relations.PersonEntityUsingPersonId);
             break;
         case "ArtworkToRoles":
             toReturn.Add(Relations.ArtworkToRoleEntityUsingRoleId);
             break;
         case "RoleToEpisodes":
             toReturn.Add(Relations.RoleToEpisodeEntityUsingRoleId);
             break;
         case "RoleToSeasons":
             toReturn.Add(Relations.RoleToSeasonEntityUsingRoleId);
             break;
         case "RoleToSeries":
             toReturn.Add(Relations.RoleToSeriesEntityUsingRoleId);
             break;
         default:
             break;
     }
     return toReturn;
 }
开发者ID:MichelZ,项目名称:TVJunkie,代码行数:28,代码来源:RoleEntity.cs

示例11: GetRelationsForField

 /// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
 /// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
 /// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
 internal static new RelationCollection GetRelationsForField(string fieldName)
 {
     RelationCollection toReturn = new RelationCollection();
     switch(fieldName)
     {
         case "Message":
             toReturn.Add(Relations.MessageEntityUsingMessageID);
             break;
         default:
             toReturn = AuditDataCoreEntity.GetRelationsForField(fieldName);
             break;
     }
     return toReturn;
 }
开发者ID:priaonehaha,项目名称:HnD,代码行数:17,代码来源:AuditDataMessageRelatedEntityBase.cs

示例12: GetRelationsForField

		/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
		/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
		/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
		internal static RelationCollection GetRelationsForField(string fieldName)
		{
			RelationCollection toReturn = new RelationCollection();
			switch(fieldName)
			{
				case "CountryRegion":
					toReturn.Add(Relations.CountryRegionEntityUsingCountryRegionCode);
					break;
				case "Currency":
					toReturn.Add(Relations.CurrencyEntityUsingCurrencyCode);
					break;
				default:
					break;				
			}
			return toReturn;
		}
开发者ID:ck-lee,项目名称:RawDataAccessBencher,代码行数:19,代码来源:CountryRegionCurrencyEntity.cs

示例13: GetRelationsForField

		/// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
		/// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
		/// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
		internal static RelationCollection GetRelationsForField(string fieldName)
		{
			RelationCollection toReturn = new RelationCollection();
			switch(fieldName)
			{
				case "CountryRegionCurrencies":
					toReturn.Add(Relations.CountryRegionCurrencyEntityUsingCountryRegionCode);
					break;
				case "SalesTerritories":
					toReturn.Add(Relations.SalesTerritoryEntityUsingCountryRegionCode);
					break;
				case "StateProvinces":
					toReturn.Add(Relations.StateProvinceEntityUsingCountryRegionCode);
					break;
				default:
					break;				
			}
			return toReturn;
		}
开发者ID:ck-lee,项目名称:RawDataAccessBencher,代码行数:22,代码来源:CountryRegionEntity.cs

示例14: GetRelationsForField

 /// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
 /// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
 /// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
 internal static RelationCollection GetRelationsForField(string fieldName)
 {
     RelationCollection toReturn = new RelationCollection();
     switch(fieldName)
     {
         case "AspnetUser":
             toReturn.Add(Relations.AspnetUsersEntityUsingUserId);
             break;
         case "SnGroupCategory":
             toReturn.Add(Relations.SnGroupCategoryEntityUsingGroupCategoryId);
             break;
         case "SnAlbum":
             toReturn.Add(Relations.SnAlbumEntityUsingSnGroupId);
             break;
         case "SnDiscussionBoard":
             toReturn.Add(Relations.SnDiscussionBoardEntityUsingSnGroupId);
             break;
         case "SnEvents":
             toReturn.Add(Relations.SnEventEntityUsingSnGroupId);
             break;
         case "SnGroupMembers":
             toReturn.Add(Relations.SnGroupMemberEntityUsingGroupId);
             break;
         case "SnGroupRequests":
             toReturn.Add(Relations.SnGroupRequestEntityUsingGroupId);
             break;
         case "SnNotes":
             toReturn.Add(Relations.SnNoteEntityUsingGroupId);
             break;
         case "SnRelationshipss":
             toReturn.Add(Relations.SnRelationshipEntityUsingGroupId);
             break;
         default:
             break;
     }
     return toReturn;
 }
开发者ID:MonoSoftware,项目名称:MonoX-Data-Access-Layer,代码行数:40,代码来源:SnGroupEntity.cs

示例15: GetMultiUsingDecisionNodeCollectionViaRule

 /// <summary>
 /// Retrieves in the calling EffectCollection object all EffectEntity objects
 /// which are related via a relation of type 'm:n' with the passed in DecisionNodeEntity. 
 /// </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. 
 /// If the used Dynamic Query Engine supports it, 'TOP' is used to limit the amount of rows to return. 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="decisionNodeInstance">DecisionNodeEntity object to be used as a filter in the m:n relation</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 GetMultiUsingDecisionNodeCollectionViaRule(ITransaction containingTransaction, IEntityCollection collectionToFill, long maxNumberOfItemsToReturn, ISortExpression sortClauses, IEntityFactory entityFactoryToUse, IEntity decisionNodeInstance, int pageNumber, int pageSize)
 {
     IEntityFields fieldsToReturn = EntityFieldsFactory.CreateEntityFieldsObject(policyDB.EntityType.EffectEntity);
     RelationCollection relations = new RelationCollection();
     relations.Add(EffectEntity.Relations.RuleEntityUsingEffectId, "Rule_");
     relations.Add(RuleEntity.Relations.DecisionNodeEntityUsingConditionId, "Rule_", string.Empty, JoinHint.None);
     IPredicateExpression selectFilter = new PredicateExpression();
     selectFilter.Add(new FieldCompareValuePredicate(decisionNodeInstance.Fields[(int)DecisionNodeFieldIndex.Id], ComparisonOperator.Equal));
     return GetMulti(containingTransaction, collectionToFill, maxNumberOfItemsToReturn, sortClauses, entityFactoryToUse, selectFilter, relations, pageNumber, pageSize);
 }
开发者ID:habibvirji,项目名称:Webinos-Platform,代码行数:24,代码来源:EffectDAO.cs


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