Click or drag to resize
IContactRelationAssignerAssign Method (Int32, MemberTypeEnum, Int32, Boolean)
Creates relationship between for given contactId and related object with given relatedId of type specified in memberType.

Namespace: CMS.ContactManagement
Assembly: CMS.ContactManagement (in CMS.ContactManagement.dll) Version: 10.0.0
Syntax
C#
void Assign(
	int relatedId,
	MemberTypeEnum memberType,
	int contactId,
	bool mergeUsers
)

Parameters

relatedId
Type: SystemInt32
ID of related object
memberType
Type: CMS.ContactManagementMemberTypeEnum
Type of object
contactId
Type: SystemInt32
Contact ID
mergeUsers
Type: SystemBoolean
Indicates if user contacts should be merged
Examples
Following example shows how to use method Assign(Int32, MemberTypeEnum, Int32, Boolean).
...
IContactRelationAssigner contactRelationAssigner = someImplementation;
var subscriber = subscriber;
var contactI = someContactId;

// Will create new ContactMembershipInfo record of type Subscriber linking to the given contact and subscriber
contactRelationAssigner.Assign(subscriber.SubscriberID, MemberTypeEnum.NewsletterSubscriber, someContactId, false);
...
See Also