Search Results for

    Show / Hide Table of Contents
    View Source

    Class Settable<T>

    Represents a value that can be assigned a value.

    Inheritance
    object
    Namespace: Umbraco.Cms.Core
    Assembly: Umbraco.Core.dll
    Syntax
    public class Settable<T>
    Type Parameters
    Name Description
    T

    The type of the value

    Properties

    View Source

    HasValue

    Gets a value indicating whether a value has been assigned to this Settable<T> instance.

    Declaration
    public bool HasValue { get; }
    Property Value
    Type Description
    bool
    View Source

    Value

    Gets the value assigned to this Settable<T> instance.

    Declaration
    public T? Value { get; }
    Property Value
    Type Description
    T
    Remarks

    An exception is thrown if the HasValue property is false.

    Exceptions
    Type Condition
    InvalidOperationException

    No value has been assigned to this instance.

    Methods

    View Source

    Clear()

    Clears the value.

    Declaration
    public void Clear()
    View Source

    Set(Settable<T>)

    Assigns a value to this Settable<T> instance by copying the value of another instance, if the other instance has a value.

    Declaration
    public void Set(Settable<T> other)
    Parameters
    Type Name Description
    Settable<T> other

    The other instance.

    View Source

    Set(T?)

    Assigns a value to this Settable<T> instance.

    Declaration
    public void Set(T? value)
    Parameters
    Type Name Description
    T value

    The value.

    View Source

    ToString()

    Returns a string that represents the current object.

    Declaration
    public override string? ToString()
    Returns
    Type Description
    string

    A string that represents the current object.

    View Source

    ValueOrDefault()

    Gets the value assigned to this Settable<T> instance, if a value has been assigned, otherwise the default value of T.

    Declaration
    public T? ValueOrDefault()
    Returns
    Type Description
    T

    The value assigned to this Settable<T> instance, if a value has been assigned, else the default value of T.

    View Source

    ValueOrDefault(T)

    Gets the value assigned to this Settable<T> instance, if a value has been assigned, otherwise a specified default value.

    Declaration
    public T? ValueOrDefault(T defaultValue)
    Parameters
    Type Name Description
    T defaultValue

    The default value.

    Returns
    Type Description
    T

    The value assigned to this Settable<T> instance, if a value has been assigned, else defaultValue.

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