Click or drag to resize
IContactRelationAssignerAssign Method (MemberTypeEnum, BaseInfo, ContactInfo, IContactDataPropagationChecker)
Adds specified relationship among specified contact, related object and object type.

Namespace: CMS.ContactManagement
Assembly: CMS.ContactManagement (in CMS.ContactManagement.dll) Version: 13.0.131
Syntax
C#
void Assign(
	MemberTypeEnum memberType,
	BaseInfo info,
	ContactInfo contact,
	IContactDataPropagationChecker checker = null
)

Parameters

memberType
Type: CMS.ContactManagementMemberTypeEnum
Type of object
info
Type: CMS.DataEngineBaseInfo
Base info of related object
contact
Type: CMS.ContactManagementContactInfo
Contact info
checker (Optional)
Type: CMS.ContactManagementIContactDataPropagationChecker
Checks whether the object should be assigned.
Examples
Following example shows how to use method Assign(MemberTypeEnum, BaseInfo, ContactInfo, IContactDataPropagationChecker).
...
IContactRelationAssigner contactRelationAssigner = someImplementation;
var subscriber = subscriber;
var contact = someContact;

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