Class Property
A Property contains a single piece of data
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
[Serializable]
[DataContract(IsReference = true)]
public class Property : Entity, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
Property()
Declaration
protected Property()
Property(Int32, Guid, PropertyType, Object)
Declaration
public Property(int id, Guid version, PropertyType propertyType, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | |
System.Guid | version | |
PropertyType | propertyType | |
System.Object | value |
Property(PropertyType)
Declaration
public Property(PropertyType propertyType)
Parameters
Type | Name | Description |
---|---|---|
PropertyType | propertyType |
Property(PropertyType, Object)
Declaration
public Property(PropertyType propertyType, object value)
Parameters
Type | Name | Description |
---|---|---|
PropertyType | propertyType | |
System.Object | value |
Properties
Alias
Returns the Alias of the PropertyType, which this Property is based on
Declaration
[DataMember]
public string Alias { get; }
Property Value
Type | Description |
---|---|
System.String |
PropertyType
Returns the PropertyType, which this Property is based on
Declaration
[IgnoreDataMember]
public PropertyType PropertyType { get; }
Property Value
Type | Description |
---|---|
PropertyType |
Value
Gets or Sets the value of the Property
Declaration
[DataMember]
public object Value { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
Remarks
Setting the value will trigger a type validation. The type of the value has to be valid in order to be saved.
Version
Gets or Sets the version id for the Property
Declaration
[DataMember]
public Guid Version { get; set; }
Property Value
Type | Description |
---|---|
System.Guid |
Remarks
The version will be the same for all Property objects in a collection on a Content object, so not sure how much this makes sense but adding it to align with: umbraco.interfaces.IProperty
Methods
DeepClone()
Declaration
public override object DeepClone()
Returns
Type | Description |
---|---|
System.Object |
IsValid()
Boolean indicating whether the current value is valid
Declaration
public bool IsValid()
Returns
Type | Description |
---|---|
System.Boolean | True is property value is valid, otherwise false |
Remarks
A valid value implies that it is ready for publishing. Invalid property values can be saved, but not published.
IsValid(Object)
Boolean indicating whether the passed in value is valid
Declaration
public bool IsValid(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value |
Returns
Type | Description |
---|---|
System.Boolean | True is property value is valid, otherwise false |