Click or drag to resize
IContactCreatorCreateContact Method
Creates and returns new contact with given namePrefix in ContactLastName. Created instance of ContactInfo is saved to the database.

Namespace: CMS.ContactManagement
Assembly: CMS.ContactManagement (in CMS.ContactManagement.dll) Version: 13.0.131
Syntax
C#
ContactInfo CreateContact(
	string namePrefix
)

Parameters

namePrefix
Type: SystemString
Prefix that will be prepend to the created ContactLastName. If null is passed, no prefix will be used

Return Value

Type: ContactInfo
Created contact
Remarks
Current date time will be used as default value of ContactLastName.
Examples

Following example shows how to use the method CreateContact(String)

...
IContactCreator contactCreator = someImplementation;

// Assume it is now midnight on 2016/01/01

// Will create new contact with ContactLastName '2016-01-01 00:00:00.000'
var contactWithoutPrefix = contactCreator.CreateContact();

// Will create new contact with ContactLastName 'prefix_2016-01-01 00:00:00.000'
var contactWithoutPrefix = contactCreator.CreateContact("prefix");
...
See Also