Skip to main content

Creating a new Entry

Log in to add to favourites

New with content type

Creates a new entry based on a content type id.

Syntax

C#
public Entry New(string contentTypeId)
{
}

Parameters

contentTypeId

Type: string
The id of content type.

Remarks

Throws an ArgumentException if the contentTypeId parameter is either null or an empty string.

Example

C#
using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Retrieve the relevant project
var movieDbProject = client.Projects.Get("moviedb");

// Create a new Movie entry
var movie = movieDbProject.Entries.New("movie");

New with content type and language

Creates a new entry based on a content type id and a language.

Syntax

C#
public Entry New(string contentTypeId, string language)
{
}

Parameters

contentTypeId

Type: string
The id of content type.

language

Type: string
The language variation of the entry to create.

Remarks

Throws an ArgumentException if the contentTypeId parameter is either null or an empty string.

Example

C#
using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Retrieve the relevant project
var movieDbProject = client.Projects.Get("moviedb");

// Create a new Movie entry for french
var movie = movieDbProject.Entries.New("movie", "fr-FR");

New with content type, language and string id

Creates a new entry based on a content type id, language and by providing the id for the entry.

Syntax

C#
public Entry New(string contentTypeId, string language)
{
}

Parameters

contentTypeId

Type: string
The id of the content type.

language

Type: string
The language variation of the entry to create.

entryId

Type: string
The id given to the entry.

Remarks

Throws an ArgumentException if the contentTypeId parameter is either null or an empty string.
A null value can be set for the language if needed so that the entry id can still be set and the default language inferred.

Example

C#
using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Retrieve the relevant project
var movieDbProject = client.Projects.Get("moviedb");

// Create a new Movie entry for french
var movie = movieDbProject.Entries.New("movie", "fr-FR", "ff1c8adf-2bd7-4ebe-88b2-37ce280d89f8");

New with content type, language and Guid

Creates a new entry based on a content type id, language and by providing the id for the entry.

Syntax

C#
public Entry New(string contentTypeId, string language)
{
}

Parameters

contentTypeId

Type: string
The id of the content type.

language

Type: string
The language variation of the entry to create.

entryId

Type: Guid
The id given to the entry.

Remarks

Throws an ArgumentException if the contentTypeId parameter is either null or an empty string.
A null value can be set for the language if needed so that the entry id can still be set and the default language inferred.

Example

C#
using Zengenti.Contensis.Management;

// Create a client
var client = ManagementClient.Create();

// Get a Guid
var entryId = Guid.Parse("ff1c8adf-2bd7-4ebe-88b2-37ce280d89f8");

// Retrieve the relevant project
var movieDbProject = client.Projects.Get("moviedb");

// Create a new Movie entry for french
var movie = movieDbProject.Entries.New("movie", "fr-FR", entryId);

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request