Interface IContactCreator
- Namespace
 - CMS.ContactManagement
 
- Assembly
 - CMS.ContactManagement.dll
 
Provides method for creating new contacts.
public interface IContactCreator
  - Extension Methods
 
Methods
CreateAnonymousContact()
Creates new anonymous contact. Created instance of ContactInfo is saved to the database. ContactLastName starts with prefix ANONYMOUS.
ContactInfo CreateAnonymousContact()
  Returns
- ContactInfo
 Created contact
Examples
Following example shows how to use the method CreateAnonymousContact()
...
IContactCreator contactCreator = someImplementation;
// Assume it is now midnight on 2016/01/01
// Will create new contact with ContactLastName 'Anonymous - 2016-01-01 00:00:00.000'
var contactWithoutPrefix = contactCreator.CreateAnonymousContact();
...
  
  CreateContact(string)
Creates and returns new contact with given namePrefix in ContactLastName.
Created instance of ContactInfo is saved to the database.
ContactInfo CreateContact(string namePrefix)
  Parameters
namePrefixstringPrefix that will be prepend to the created ContactLastName. If null is passed, no prefix will be used
Returns
- ContactInfo
 Created contact
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");
...
  Remarks
Current date time will be used as default value of ContactLastName.