JsonValueExtensionsGetTimeOnlyOrDefault(JsonValue, TimeOnly, JsonValueType) Method
Namespace: KGySoft.JsonAssembly: KGySoft.Json (in KGySoft.Json.dll) Version: 3.0.0
public static TimeOnly GetTimeOnlyOrDefault(
this JsonValue json,
TimeOnly defaultValue = default,
JsonValueType expectedType = JsonValueType.Undefined
)
<ExtensionAttribute>
Public Shared Function GetTimeOnlyOrDefault (
json As JsonValue,
Optional defaultValue As TimeOnly = Nothing,
Optional expectedType As JsonValueType = JsonValueType.Undefined
) As TimeOnly
public:
[ExtensionAttribute]
static TimeOnly GetTimeOnlyOrDefault(
JsonValue json,
TimeOnly defaultValue = TimeOnly(),
JsonValueType expectedType = JsonValueType::Undefined
)
[<ExtensionAttribute>]
static member GetTimeOnlyOrDefault :
json : JsonValue *
?defaultValue : TimeOnly *
?expectedType : JsonValueType
(* Defaults:
let _defaultValue = defaultArg defaultValue new TimeOnly()
let _expectedType = defaultArg expectedType JsonValueType.Undefined
*)
-> TimeOnly
- json JsonValue
- The JsonValue to be converted to TimeOnly.
- defaultValue TimeOnly (Optional)
- The value to be returned if the conversion fails. This parameter is optional.
Default value: MinValue. - expectedType JsonValueType (Optional)
- The expected Type of the specified json parameter,
or Undefined to allow any type. This parameter is optional.
Default value: Undefined.
TimeOnlyA
TimeOnly value if
json could be converted; otherwise,
defaultValue.In Visual Basic and C#, you can call this method as an instance method on any object of type
JsonValue. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).