Interface IContentBase
Defines the base for a Content object with properties that are shared between Content and Media.
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
public interface IContentBase : IUmbracoEntity, IAggregateRoot, IDeletableEntity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Properties
ContentTypeId
Integer Id of the default ContentType
Declaration
int ContentTypeId { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Properties
List of properties, which make up all the data available for this Content object
Declaration
PropertyCollection Properties { get; set; }
Property Value
Type | Description |
---|---|
PropertyCollection |
Remarks
Properties are loaded as part of the Content object graph
PropertyGroups
List of PropertyGroups available on this Content object
Declaration
IEnumerable<PropertyGroup> PropertyGroups { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PropertyGroup> |
Remarks
PropertyGroups are kind of lazy loaded as part of the object graph
PropertyTypes
List of PropertyTypes available on this Content object
Declaration
IEnumerable<PropertyType> PropertyTypes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<PropertyType> |
Remarks
PropertyTypes are kind of lazy loaded as part of the object graph
Version
Gets the Guid Id of the Content's Version
Declaration
Guid Version { get; }
Property Value
Type | Description |
---|---|
System.Guid |
Methods
ChangeTrashedState(Boolean, Int32)
Changes the Trashed state of the content object
Declaration
void ChangeTrashedState(bool isTrashed, int parentId = -20)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isTrashed | Boolean indicating whether content is trashed (true) or not trashed (false) |
System.Int32 | parentId |
GetValue(String)
Gets the value of a Property
Declaration
object GetValue(string propertyTypeAlias)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyTypeAlias | Alias of the PropertyType |
Returns
Type | Description |
---|---|
System.Object | Property Value as an System.Object |
GetValue<TPassType>(String)
Gets the value of a Property
Declaration
TPassType GetValue<TPassType>(string propertyTypeAlias)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyTypeAlias | Alias of the PropertyType |
Returns
Type | Description |
---|---|
TPassType | Property Value as a |
Type Parameters
Name | Description |
---|---|
TPassType | Type of the value to return |
HasProperty(String)
Indicates whether the content object has a property with the supplied alias
Declaration
bool HasProperty(string propertyTypeAlias)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyTypeAlias | Alias of the PropertyType |
Returns
Type | Description |
---|---|
System.Boolean | True if Property with given alias exists, otherwise False |
IsValid()
Boolean indicating whether the content and its properties are valid
Declaration
bool IsValid()
Returns
Type | Description |
---|---|
System.Boolean | True if content is valid otherwise false |
SetValue(String, Object)
Sets the System.Object value of a Property
Declaration
void SetValue(string propertyTypeAlias, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | propertyTypeAlias | Alias of the PropertyType |
System.Object | value | Value to set for the Property |