Table of Contents

Method DeserializeJsonLoadSerializedAsync

Namespace
Kepware.Api.ClientHandler
Assembly
Kepware.Api.dll

DeserializeJsonLoadSerializedAsync<K>(HttpResponseMessage, CancellationToken)

Special deserialization method for responses from endpoints with ?content=serialize that wrap the actual object in an additional layer with the object name as the property name, e.g. { "Channel": { ... } }. This is required to properly handle dynamic properties on channels/devices/etc that conform to a different model from JSON type info for the base entity. This would cause
deserialization to fail if we tried to deserialize directly to the target type.

protected Task<K?> DeserializeJsonLoadSerializedAsync<K>(HttpResponseMessage httpResponse, CancellationToken cancellationToken = default) where K : BaseEntity, new()

Parameters

httpResponse HttpResponseMessage
cancellationToken CancellationToken

Returns

Task<K>

Type Parameters

K

DeserializeJsonLoadSerializedAsync<K>(HttpResponseMessage, JsonTypeInfo<K>, CancellationToken)

Special deserialization method for responses from endpoints with ?content=serialize that wrap the actual object in an additional layer with the object name as the property name, e.g. { "Channel": { ... } }. This is required to properly handle dynamic properties on channels/devices/etc that conform to a different model from JSON type info for the base entity. This would cause
deserialization to fail if we tried to deserialize directly to the target type.

protected Task<K?> DeserializeJsonLoadSerializedAsync<K>(HttpResponseMessage httpResponse, JsonTypeInfo<K> jsonTypeInfo, CancellationToken cancellationToken = default) where K : BaseEntity, new()

Parameters

httpResponse HttpResponseMessage
jsonTypeInfo JsonTypeInfo<K>
cancellationToken CancellationToken

Returns

Task<K>

Type Parameters

K