Search Results for

    Show / Hide Table of Contents
    View Source

    Class PublishedPropertyExtension

    Provides extension methods for IPublishedProperty.

    Inheritance
    object
    Namespace: Umbraco.Extensions
    Assembly: Umbraco.Core.dll
    Syntax
    public static class PublishedPropertyExtension

    Methods

    View Source

    Value(IPublishedProperty, IPublishedValueFallback, string?, string?, Fallback, object?)

    Gets the value of a published property with fallback support.

    Declaration
    public static object? Value(this IPublishedProperty property, IPublishedValueFallback publishedValueFallback, string? culture = null, string? segment = null, Fallback fallback = default, object? defaultValue = null)
    Parameters
    Type Name Description
    IPublishedProperty property

    The published property.

    IPublishedValueFallback publishedValueFallback

    The published value fallback implementation.

    string culture

    The variation language.

    string segment

    The variation segment.

    Fallback fallback

    The fallback strategy.

    object defaultValue

    The default value if no value is found.

    Returns
    Type Description
    object

    The property value, or the fallback/default value if not found.

    View Source

    Value<T>(IPublishedProperty, IPublishedValueFallback, string?, string?, Fallback, T?)

    Gets the value of a published property converted to the specified type, with fallback support.

    Declaration
    public static T? Value<T>(this IPublishedProperty property, IPublishedValueFallback publishedValueFallback, string? culture = null, string? segment = null, Fallback fallback = default, T? defaultValue = default)
    Parameters
    Type Name Description
    IPublishedProperty property

    The published property.

    IPublishedValueFallback publishedValueFallback

    The published value fallback implementation.

    string culture

    The variation language.

    string segment

    The variation segment.

    Fallback fallback

    The fallback strategy.

    T defaultValue

    The default value if no value is found.

    Returns
    Type Description
    T

    The property value converted to the specified type, or the fallback/default value if not found.

    Type Parameters
    Name Description
    T

    The target type to convert the value to.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX