Interface IProperty
Represents a property on a content item.
Namespace: Umbraco.Cms.Core.Models
Assembly: Umbraco.Core.dll
Syntax
public interface IProperty : IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Properties
View SourceAlias
Returns the Alias of the PropertyType, which this Property is based on
Declaration
string Alias { get; }
Property Value
| Type | Description |
|---|---|
| string |
PropertyType
Returns the PropertyType, which this Property is based on
Declaration
IPropertyType PropertyType { get; }
Property Value
| Type | Description |
|---|---|
| IPropertyType |
PropertyTypeId
Gets the identifier of the property type.
Declaration
int PropertyTypeId { get; }
Property Value
| Type | Description |
|---|---|
| int |
ValueStorageType
Gets the value storage type for this property.
Declaration
ValueStorageType ValueStorageType { get; }
Property Value
| Type | Description |
|---|---|
| ValueStorageType |
Values
Gets the list of values.
Declaration
IReadOnlyCollection<IPropertyValue> Values { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCollection<IPropertyValue> |
Methods
View SourceGetValue(string?, string?, bool)
Gets the value.
Declaration
object? GetValue(string? culture = null, string? segment = null, bool published = false)
Parameters
| Type | Name | Description |
|---|---|---|
| string | culture | |
| string | segment | |
| bool | published |
Returns
| Type | Description |
|---|---|
| object |
PublishPartialValues(IDataEditor, string?)
Publishes partial property values for a specific data editor and culture.
Declaration
void PublishPartialValues(IDataEditor dataEditor, string? culture)
Parameters
| Type | Name | Description |
|---|---|---|
| IDataEditor | dataEditor | The data editor handling the partial publish. |
| string | culture | The culture to publish. |
PublishValues(string?, string)
Publishes property values for the specified culture and segment.
Declaration
void PublishValues(string? culture = "*", string segment = "*")
Parameters
| Type | Name | Description |
|---|---|---|
| string | culture | The culture to publish, or "*" for all cultures. |
| string | segment | The segment to publish, or "*" for all segments. |
SetValue(object?, string?, string?)
Sets a value.
Declaration
bool SetValue(object? value, string? culture = null, string? segment = null)
Parameters
| Type | Name | Description |
|---|---|---|
| object | value | |
| string | culture | |
| string | segment |
Returns
| Type | Description |
|---|---|
| bool | true if the value was set (updated), false otherwise. |
Remarks
A false return value does not indicate failure, but rather that the property value was not changed (i.e. the value passed in was equal to the current property value).
UnpublishValues(string?, string)
Unpublishes property values for the specified culture and segment.
Declaration
void UnpublishValues(string? culture = "*", string segment = "*")
Parameters
| Type | Name | Description |
|---|---|---|
| string | culture | The culture to unpublish, or "*" for all cultures. |
| string | segment | The segment to unpublish, or "*" for all segments. |