ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Core.Rdl Assembly / GrapeCity.ActiveReports.Core.Rdl.Persistence.Json Namespace / JsonCoders Class / Optional Method / Optional<T>(JsonCoder<T>,T) Method
The type of the value.
A JsonCoder<T> to encode and decode the value.
The default value.

In This Topic
    Optional<T>(JsonCoder<T>,T) Method
    In This Topic
    Encodes the specified default value as undefined and skips it during serialization. During deserialization, the undefined value will be replaced with the specified default value.
    Syntax
    'Declaration
     
    Public Overloads Shared Function Optional(Of T)( _
       ByVal coder As JsonCoder(Of T), _
       ByVal defValue As T _
    ) As JsonCoder(Of T)
    public static JsonCoder<T> Optional<T>( 
       JsonCoder<T> coder,
       T defValue
    )

    Parameters

    coder
    A JsonCoder<T> to encode and decode the value.
    defValue
    The default value.

    Type Parameters

    T
    The type of the value.

    Return Value

    A JsonCoder<T> with the default value handling.
    See Also