Class JsonStreamResourceConverter
Common resource converter to support polymorphic deserialization.
Inheritance
System.Object
JsonStreamResourceConverter
Assembly: fhirCsR2.dll
Syntax
public class JsonStreamResourceConverter : JsonConverter<Resource>
Methods
|
Improve this Doc
View Source
CanConvert(Type)
Determines whether the specified type can be converted.
Declaration
public override bool CanConvert(Type objectType)
Parameters
Type |
Name |
Description |
Type |
objectType |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
DoPolymorphicRead(ref Utf8JsonReader, JsonSerializerOptions, String)
Sub-function for simpler handling of reader switching.
Declaration
public static Resource DoPolymorphicRead(ref Utf8JsonReader reader, JsonSerializerOptions options, string resourceType)
Parameters
Type |
Name |
Description |
Utf8JsonReader |
reader |
|
JsonSerializerOptions |
options |
|
System.String |
resourceType |
|
Returns
|
Improve this Doc
View Source
PolymorphicRead(ref Utf8JsonReader, Type, JsonSerializerOptions)
Read override to handle polymorphic reading of resources.
Declaration
public static Resource PolymorphicRead(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
Type |
Name |
Description |
Utf8JsonReader |
reader |
|
Type |
typeToConvert |
|
JsonSerializerOptions |
options |
|
Returns
|
Improve this Doc
View Source
Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to a typed object.
Declaration
public override Resource Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
Type |
Name |
Description |
Utf8JsonReader |
reader |
|
Type |
typeToConvert |
|
JsonSerializerOptions |
options |
|
Returns
|
Improve this Doc
View Source
Write(Utf8JsonWriter, Resource, JsonSerializerOptions)
Writes a specified value as JSON.
Declaration
public override void Write(Utf8JsonWriter writer, Resource resource, JsonSerializerOptions options)
Parameters
Type |
Name |
Description |
Utf8JsonWriter |
writer |
|
Resource |
resource |
|
JsonSerializerOptions |
options |
|