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

Namespace: CMS.ContactManagement
Assembly: CMS.ContactManagement (in CMS.ContactManagement.dll) Version: 10.0.0
Syntax
C#
void Assign(
	MemberTypeEnum memberType,
	BaseInfo info,
	ContactInfo contact,
	bool mergeUsers
)

Parameters

memberType
Type: CMS.ContactManagementMemberTypeEnum
Type of object
info
Type: CMS.DataEngineBaseInfo
Base info of related object
contact
Type: CMS.ContactManagementContactInfo
Contact info
mergeUsers
Type: SystemBoolean
Indicates if users should be merged
Examples
Following example shows how to use method Assign(MemberTypeEnum, BaseInfo, ContactInfo, Boolean).
...
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, false);
...
See Also