ContentType

View as Markdown

ContentType

ContentType provides Entry and Query instance.

NameTypeDescription
ContentTypeId string

Content type uid

SetHeader

To set headers for Contentstack rest calls.

NameTypeDescription
keystring

header name.

valuestring

header value against given header name.

using Contentstack.Core; 

using Contentstack.Core.Models;


ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");

ContentType contentType = stack.ContentType("content_type_uid").SetHeader("custom_key", "custom_value");

RemoveHeader

Remove header key.

NameTypeDescription
keystring

key to be remove from header

using Contentstack.Core; 

using Contentstack.Core.Models;


ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");

ContentType contentType = await stack.ContentType("content_type_uid").RemoveHeader("header_to_remove");

Fetch

This method returns the complete information, of a specific content type.

NameTypeDescription
paramDictionary<Object>

Dictionary of additional parameter

using Contentstack.Core; 

using Contentstack.Core.Models;


ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");

var param = new Dictionary<string, object>();

param.Add("include_global_field_schema",true);

var result = await stack.ContentType("content_Type_uid").Fetch(param);

Entry

Represents a Entry. Create Entry Instance.

NameTypeDescription
entryUidstring

Set entry uid.

using Contentstack.Core; 

using Contentstack.Core.Models;


ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");

Entry entry = stack.ContentType("content_Type_uid").Entry("entry_uid");

Query

Represents a Query Create Query Instance.

using Contentstack.Core; 

using Contentstack.Core.Models;


ContentstackClient stack = new ContentstackClient("api_key", "delivery_token", "environment");

Query query = stack.ContentType("content_Type_uid").Query();