Method GetJsonContent
GetJsonContent<T>(JsonTypeInfo<T>)
Deserializes the request body into an object of type T
using the provided JsonTypeInfo<T>.
public T? GetJsonContent<T>(JsonTypeInfo<T> typeInfo)
Parameters
typeInfo
JsonTypeInfo<T>The JsonTypeInfo<T> to use for deserialization.
Returns
- T
The deserialized object, or
null
if the request body is empty.
Type Parameters
T
The type of the object to deserialize into.
GetJsonContent<T>(JsonSerializerOptions?)
Deserializes the request body into an object of type T
using the provided JsonSerializerOptions.
public T? GetJsonContent<T>(JsonSerializerOptions? jsonOptions = null)
Parameters
jsonOptions
JsonSerializerOptionsThe JsonSerializerOptions to use for deserialization.
Returns
- T
The deserialized object, or
null
if the request body is empty.
Type Parameters
T
The type of the object to deserialize into.
GetJsonContent<T>()
Deserializes the request body into an object of type T
using the default
JsonSerializerOptions from DefaultJsonSerializerOptions.
public T? GetJsonContent<T>()
Returns
- T
The deserialized object, or
null
if the request body is empty.
Type Parameters
T
The type of the object to deserialize into.