Class CustomPointOfCareConverter
- Namespace
- adas_core.Infrastructure.Utils
- Assembly
- adas-core.Infrastructure.dll
Provides a custom JSON conversion implementation for point of care data, extending the base Newtonsoft.Json.JsonConverter functionality.
public class CustomPointOfCareConverter : JsonConverter
- Inheritance
-
JsonConverterCustomPointOfCareConverter
- Inherited Members
-
JsonConverter.CanReadJsonConverter.CanWrite
- Extension Methods
Remarks
This converter is designed to handle the serialization and deserialization logic specific to point of care entities, tailoring the behavior inherited from the Newtonsoft.Json.JsonConverter base class.
Methods
CanConvert(Type)
Determines whether the converter can convert the specified type. Returns true only when the supplied type is PointOfCare; otherwise, returns false.
public override bool CanConvert(Type objectType)
Parameters
objectTypeTypeThe type to evaluate for convertibility.
Returns
- bool
trueifobjectTypeequals PointOfCare; otherwise,false.
ReadJson(JsonReader, Type, object?, JsonSerializer)
Reads the JSON representation of the object.
public override object ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
Parameters
readerJsonReaderThe Newtonsoft.Json.JsonReader to read from.
objectTypeTypeType of the object.
existingValueobjectThe existing value of object being read.
serializerJsonSerializerThe calling serializer.
Returns
- object
The object value.
WriteJson(JsonWriter, object?, JsonSerializer)
Writes the JSON representation of the object.
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
Parameters
writerJsonWriterThe Newtonsoft.Json.JsonWriter to write to.
valueobjectThe value.
serializerJsonSerializerThe calling serializer.