ContentType
ContentType
ContentType provides Entry and Query instance.
| Name | Type | Description |
|---|---|---|
| ContentTypeId | string | Content type uid |
SetHeader
To set headers for Contentstack rest calls.
| Name | Type | Description |
|---|---|---|
| key | string | header name. |
| value | string | 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.
| Name | Type | Description |
|---|---|---|
| key | string | 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.
| Name | Type | Description |
|---|---|---|
| param | Dictionary<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.
| Name | Type | Description |
|---|---|---|
| entryUid | string | 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();