Interface IContent
Defines a Content object
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
public interface IContent : IContentBase, IUmbracoEntity, IAggregateRoot, IDeletableEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Properties
ContentType
Gets the ContentType used by this content object
Declaration
IContentType ContentType { get; }
Property Value
Type | Description |
---|---|
IContentType |
ExpireDate
Gets or Sets the date the Content should expire and thus be unpublished
Declaration
DateTime? ExpireDate { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> |
HasPublishedVersion
Gets a value indicating whether the content has a published version.
Declaration
bool HasPublishedVersion { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsBlueprint
Gets a value indicating whether the content item is a blueprint.
Declaration
bool IsBlueprint { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Language
Declaration
[Obsolete("This will be removed in future versions")]
string Language { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Published
Boolean indicating whether the Content is Published or not
Declaration
bool Published { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
PublishedVersionGuid
Gets the unique identifier of the published version, if any.
Declaration
Guid PublishedVersionGuid { get; }
Property Value
Type | Description |
---|---|
System.Guid |
ReleaseDate
Gets or Sets the date the Content should be released and thus be published
Declaration
DateTime? ReleaseDate { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.DateTime> |
Status
Gets the current status of the Content
Declaration
ContentStatus Status { get; }
Property Value
Type | Description |
---|---|
ContentStatus |
Template
Gets or sets the template used by the Content. This is used to override the default one from the ContentType.
Declaration
ITemplate Template { get; set; }
Property Value
Type | Description |
---|---|
ITemplate |
WriterId
Id of the user who wrote/updated the Content
Declaration
int WriterId { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
ChangeContentType(IContentType)
Changes the IContentType for the current content object
Declaration
void ChangeContentType(IContentType contentType)
Parameters
Type | Name | Description |
---|---|---|
IContentType | contentType | New ContentType for this content |
Remarks
Leaves PropertyTypes intact after change
ChangeContentType(IContentType, Boolean)
Changes the IContentType for the current content object and removes PropertyTypes, which are not part of the new ContentType.
Declaration
void ChangeContentType(IContentType contentType, bool clearProperties)
Parameters
Type | Name | Description |
---|---|---|
IContentType | contentType | New ContentType for this content |
System.Boolean | clearProperties | Boolean indicating whether to clear PropertyTypes upon change |
ChangePublishedState(PublishedState)
Changes the Published state of the content object
Declaration
void ChangePublishedState(PublishedState state)
Parameters
Type | Name | Description |
---|---|---|
PublishedState | state |
DeepCloneWithResetIdentities()
Creates a deep clone of the current entity with its identity/alias and it's property identities reset
Declaration
IContent DeepCloneWithResetIdentities()
Returns
Type | Description |
---|---|
IContent |