Ejemplo n.º 1
0
 /// <summary>
 /// Gets an umbraco property from the passed content, and returns it in the type specified by the DocTypeProperty.
 /// </summary>
 /// <typeparam name="TType">Type to deliver the property value as.</typeparam>
 /// <param name="content">Content to get the property from.</param>
 /// <param name="property">The DocTypeProperty that contains information on how to receive the property.</param>
 /// <returns>The value of the property, in the type specified by the passed DocTypeProperty</returns>
 public static TType GetPropertyValue <TType>(this IPublishedContent content, IDocTypeProperty <TType> property)
 {
     return(content.GetPropertyValue(property, false));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets an umbraco property from the passed content, and returns it in the type specified by the DocTypeProperty.
 /// </summary>
 /// <typeparam name="TType">Type to deliver the property value as.</typeparam>
 /// <param name="content">Content to get the property from.</param>
 /// <param name="property">The DocTypeProperty that contains information on how to receive the property.</param>
 /// <param name="recursive">Defines if it should recursively go through ancestors for the property. Default is false.</param>
 /// <returns>The value of the property, in the type specified by the passed DocTypeProperty</returns>
 public static TType GetPropertyValue <TType>(this IPublishedContent content, IDocTypeProperty <TType> property, bool recursive)
 {
     return(property.Map(content, recursive));
 }