Click or drag to resize
IContactRelationAssignerAssign Method (Int32, MemberTypeEnum, Int32, IContactDataPropagationChecker)
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: 13.0.131
Syntax
C#
void Assign(
	int relatedId,
	MemberTypeEnum memberType,
	int contactId,
	IContactDataPropagationChecker checker = null
)

Parameters

relatedId
Type: SystemInt32
ID of related object
memberType
Type: CMS.ContactManagementMemberTypeEnum
Type of object
contactId
Type: SystemInt32
Contact ID
checker (Optional)
Type: CMS.ContactManagementIContactDataPropagationChecker
Checks whether the object should be assigned.
Examples
Following example shows how to use method Assign(Int32, MemberTypeEnum, Int32, IContactDataPropagationChecker).
...
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);
...
See Also