Class Entry
Entry is used to create, update and delete contentType's entries on the Contentstack.io Content stack.
Inheritance
Inherited Members
Namespace: Contentstack.Core.Models
Assembly: Contentstack.Core.dll
Syntax
public class Entry
Properties
| Improve this Doc View SourceMetadata
Set key/value attributes of Metadata.
Declaration
public Dictionary<string, object> Metadata { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.Metadata;
});
|
Improve this Doc
View Source
Object
Set key/value attributes of an current entry instance.
Declaration
public Dictionary<string, object> Object { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.Object;
});
|
Improve this Doc
View Source
Tags
Set array of Tags
Declaration
public object[] Tags { get; set; }
Property Value
Type | Description |
---|---|
System.Object[] |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.Tags;
});
|
Improve this Doc
View Source
Title
Title of an entry
Declaration
public string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.Title;
});
|
Improve this Doc
View Source
Uid
This is Entry Uid of an entry.
Declaration
public string Uid { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.Uid;
});
Methods
| Improve this Doc View SourceExcept(String[])
Specifies list of field uids that would be excluded from the response.
Declaration
public Entry Except(string[] fieldUid)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | fieldUid | field uid which get excluded from the response. |
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Except(new String[]{"name", "description"});
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
Fetch<T>()
Fetches the latest version of the entries from Contentstack.io content stack
Declaration
public async Task<T> Fetch<T>()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | Current instance of Entry, this will be useful for a chaining calls. |
Type Parameters
Name | Description |
---|---|
T |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
Get(String)
Get object value for key.
Declaration
public object Get(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | key to get value |
Returns
Type | Description |
---|---|
System.Object | object value |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.Get("key");
});
|
Improve this Doc
View Source
GetContentType()
Get contentType name.
Declaration
public string GetContentType()
Returns
Type | Description |
---|---|
System.String | contentType name |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.GetContentType()
|
Improve this Doc
View Source
GetCreateAt()
Get value of creation time of entry.
Declaration
public DateTime GetCreateAt()
Returns
Type | Description |
---|---|
System.DateTime | created date time in datetime format |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetCreateAt();
});
|
Improve this Doc
View Source
GetCreatedBy()
Get uid who created this entry.
Declaration
public string GetCreatedBy()
Returns
Type | Description |
---|---|
System.String | uid who created this entry |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetCreatedBy();
});
|
Improve this Doc
View Source
GetDeletedAt()
Get value of deleting time of entry.
Declaration
public DateTime GetDeletedAt()
Returns
Type | Description |
---|---|
System.DateTime | deleted date time in datetime format |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetDeletedAt();
});
|
Improve this Doc
View Source
GetDeletedBy()
Get uid who deleted this entry.
Declaration
public string GetDeletedBy()
Returns
Type | Description |
---|---|
System.String | uid who deleted this entry |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetDeletedBy();
});
|
Improve this Doc
View Source
GetHTMLText(String)
Get html text for markdown data type
Declaration
public string GetHTMLText(string markdownKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | markdownKey | field_uid as key. |
Returns
Type | Description |
---|---|
System.String | html text in string format. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetHTMLText("markdownKey")
});
|
Improve this Doc
View Source
GetMetadata()
Get metadata of entry.
Declaration
public Dictionary<string, object> GetMetadata()
Returns
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.String, System.Object> | key/value attributes of metadata |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetMetadata();
});
|
Improve this Doc
View Source
GetMultipleHTMLText(String)
Get html text for markdown data type which is multiple true
Declaration
public List<string> GetMultipleHTMLText(string markdownKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | markdownKey | field_uid as key. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> | html text in string format. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetMultipleHTMLText("markdownKey")
});
|
Improve this Doc
View Source
GetTags()
Returns tags of this entry.
Declaration
public object[] GetTags()
Returns
Type | Description |
---|---|
System.Object[] | Array of tags. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetTags();
});
|
Improve this Doc
View Source
GetTitle()
Get title
Declaration
public string GetTitle()
Returns
Type | Description |
---|---|
System.String | title |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetTitle();
});
|
Improve this Doc
View Source
GetUid()
Get uid
Declaration
public string GetUid()
Returns
Type | Description |
---|---|
System.String | Uid |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetUid();
});
|
Improve this Doc
View Source
GetUpdateAt()
Get value of updating time of entry.
Declaration
public DateTime GetUpdateAt()
Returns
Type | Description |
---|---|
System.DateTime | updated date time in datetime format |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetUpdateAt();
});
|
Improve this Doc
View Source
GetUpdatedBy()
Get uid who updated this entry.
Declaration
public string GetUpdatedBy()
Returns
Type | Description |
---|---|
System.String | uid who updated this entry |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetUpdatedBy();
});
|
Improve this Doc
View Source
IncludeBranch()
Include branch for publish content.
Declaration
public Entry IncludeBranch()
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.IncludeBranch();
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
includeEmbeddedItems()
Include Embedded Objects (Entries and Assets) along with entry/entries details.
Declaration
public Entry includeEmbeddedItems()
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.includeEmbeddedItems();
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
IncludeExceptReference(String[], String)
Specifies an array of except keys that would be excluded in the response.
Declaration
public Entry IncludeExceptReference(string[] keys, string referenceKey)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | keys | Array of the except reference keys to be excluded in response. |
System.String | referenceKey | Key who has reference to some other class object. |
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.IncludeExceptReference(new String[]{"name", "description"},"referenceUid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
IncludeFallback()
Include fallback locale publish content, if specified locale content is not publish.
Declaration
public Entry IncludeFallback()
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.IncludeFallback();
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
IncludeOnlyReference(String[], String)
Specifies an array of only keys that would be included in the response.
Declaration
public Entry IncludeOnlyReference(string[] keys, string referenceKey)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | keys | Array of the only reference keys to be included in response. |
System.String | referenceKey | Key who has reference to some other class object. |
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.IncludeOnlyReference(new String[]{"name", "description"}, "referenceUid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
IncludeOwner()
This method also includes owner information for all the entries returned in the response.
Declaration
public Entry IncludeOwner()
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.IncludeOwner();
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
IncludeReference(String)
Add a constraint that requires a particular reference key details.
Declaration
public Entry IncludeReference(string referenceField)
Parameters
Type | Name | Description |
---|---|---|
System.String | referenceField | key that to be constrained. |
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.IncludeReference("name");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
IncludeReference(String[])
Add a constraint that requires a particular reference key details.
Declaration
public Entry IncludeReference(string[] referenceFields)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | referenceFields | array key that to be constrained. |
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.IncludeReference(new String[]{"name", "description"});
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
IncludeReferenceContentTypeUID()
This method also includes the content type UIDs of the referenced entries returned in the response.
Declaration
public Entry IncludeReferenceContentTypeUID()
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.IncludeReferenceContentTypeUID();
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
Only(String[])
Specifies an array ofonly keys in BASE object that would be included in the response.
Declaration
public Entry Only(string[] fieldUid)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | fieldUid | Array of the only reference keys to be included in response. |
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Only(new String[]{"name", "description"});
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
RemoveHeader(String)
Remove header key.
Declaration
public void RemoveHeader(string key)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | custom_header_key |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.RemoveHeader("custom_key");
|
Improve this Doc
View Source
SetCachePolicy(CachePolicy)
To set cache policy using Entry instance.
Declaration
public Entry SetCachePolicy(CachePolicy cachePolicy)
Parameters
Type | Name | Description |
---|---|---|
CachePolicy | cachePolicy | CachePolicy instance |
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.SetCachePolicy(CachePolicy.NetworkElseCache);
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
});
|
Improve this Doc
View Source
SetHeader(String, String)
Set headers.
Declaration
public void SetHeader(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | custom_header_key |
System.String | value | custom_header_value |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.SetHeader("custom_key", "custom_value");
|
Improve this Doc
View Source
SetLanguage(Language)
Set Language instance
Declaration
[Obsolete("This method has been deprecated. Use SetLocale instead.", true)]
public Entry SetLanguage(Language language)
Parameters
Type | Name | Description |
---|---|---|
Contentstack.Core.Internals.Language | language | Language value |
Returns
Type | Description |
---|---|
Entry | Current instance of Entry, this will be useful for a chaining calls. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.SetLanguage(Language.ENGLISH_UNITED_STATES);
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetMetadata();
});
|
Improve this Doc
View Source
SetLocale(String)
Sets the locale.
Declaration
public Entry SetLocale(string Locale)
Parameters
Type | Name | Description |
---|---|---|
System.String | Locale | Locale. |
Returns
Type | Description |
---|---|
Entry | The locale. |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.SetLocale("en-us");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.GetMetadata();
});
|
Improve this Doc
View Source
SetTags(String[])
Assign a tag(s) for this Entry.
Declaration
public void SetTags(string[] tags)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | tags | Collection of tags. |
SetUid(String)
Assigns a uid to current instance of an entry.
Declaration
public void SetUid(string uid)
Parameters
Type | Name | Description |
---|---|---|
System.String | uid | Uid of an Entry |
ToJson()
Get key/value pairs in json of current instance.
Declaration
public JObject ToJson()
Returns
Type | Description |
---|---|
Newtonsoft.Json.Linq.JObject | json in string format |
Examples
ContentstackClient stack = new ContentstackClinet("api_key", "delivery_token", "environment");
Entry entry = stack.ContentType("contentType_id").Entry("entry_uid");
entry.Fetch<Product>().ContinueWith((entryResult) => {
//Your callback code.
//var result = entryResult.Result.ToJson();
});