Skip to content

ToObject Method ​

Definition ​

  • Namespace: JASE.Extensions
  • Assembly: JASE.Primitives.dll

Overloads ​

NameDescription
T ToObject(JsonElement element, JsonSerializerOptions options = null)Deserialize (materialize) a JsonElement into the requested CLR type.
object ToObject(JsonElement element, Type type, JsonSerializerOptions options = null)Deserialize (materialize) a JsonElement into the requested CLR type.

object ToObject(JsonElement element, Type type, JsonSerializerOptions options = null) ​

csharp
object ToObject(JsonElement element, Type type, JsonSerializerOptions options = null)

Deserialize (materialize) a JsonElement into the requested CLR type.

Parameters ​

NameDescription
elementThe JSON element to materialize.
optionsOptional serializer options; when , JASE.Primitives defaults are used.
typeThe destination CLR type.

Returns ​

The materialized object, or .

T ToObject(JsonElement element, JsonSerializerOptions options = null) ​

csharp
T ToObject(JsonElement element, JsonSerializerOptions options = null)

Deserialize (materialize) a JsonElement into the requested CLR type.

Type parameters ​

NameDescription
TThe destination CLR type.

Parameters ​

NameDescription
elementThe JSON element to materialize.
optionsOptional serializer options; when , JASE.Primitives defaults are used.

Returns ​

The materialized object, or .