Interface IPublishedProperty
Represents a property of an IPublishedContent
.
Namespace:System.Dynamic.ExpandoObject
Assembly:Umbraco.Core.dll
Syntax
public interface IPublishedProperty
Properties
DataValue
Gets the data value of the property.
Declaration
object DataValue { get; }
Property Value
Type | Description |
---|---|
System.Object |
Remarks
The data value is whatever was passed to the property when it was instanciated, and it is somewhat implementation-dependent -- depending on how the IPublishedCache is implemented.
The XmlPublishedCache raw values are strings exclusively since they come from the Xml cache.
For other caches that get their raw value from the database, it would be either a string, an integer (Int32), or a date and time (DateTime).
If you're using that value, you're probably wrong, unless you're doing some internal Umbraco stuff.
HasValue
Gets a value indicating whether the property has a value.
Declaration
bool HasValue { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
This is somewhat implementation-dependent -- depending on whatever IPublishedCache considers a missing value.
The XmlPublishedCache raw values are strings, and it will consider missing, null or empty (and that includes whitespace-only) strings as "no value".
Other caches that get their raw value from the database would consider that a property has "no value" if it is missing, null, or an empty string (including whitespace-only).
PropertyTypeAlias
Gets the alias of the property.
Declaration
string PropertyTypeAlias { get; }
Property Value
Type | Description |
---|---|
System.String |
Value
Gets the object value of the property.
Declaration
object Value { get; }
Property Value
Type | Description |
---|---|
System.Object |
Remarks
The value is what you want to use when rendering content in an MVC view ie in C#.
It can be null, or any type of CLR object.
It has been fully prepared and processed by the appropriate converter.
XPathValue
Gets the XPath value of the property.
Declaration
object XPathValue { get; }
Property Value
Type | Description |
---|---|
System.Object |
Remarks
The XPath value is what you want to use when navigating content via XPath eg in the XSLT engine.
It must be either null, or a string, or an XPathNavigator.
It has been fully prepared and processed by the appropriate converter.