Class PatientObservationAlarmConverter
- Namespace
- adas_core.Infrastructure.Utils
- Assembly
- adas-core.Infrastructure.dll
Converts PatientObservationAlarm instances to and from JSON representation.
public class PatientObservationAlarmConverter : JsonConverter<PatientObservationAlarm>, IBsonSerializer
- Inheritance
-
JsonConverterJsonConverter<PatientObservationAlarm>PatientObservationAlarmConverter
- Implements
-
IBsonSerializer
- Inherited Members
-
JsonConverter.CanReadJsonConverter.CanWrite
- Extension Methods
Remarks
Implements MongoDB.Bson.Serialization.IBsonSerializer to provide BSON serialization and deserialization support for PatientObservationAlarm objects.
Properties
ValueType
Gets the type of the value.
public Type ValueType { get; }
Property Value
- Type
The type of the value.
Methods
Deserialize(BsonDeserializationContext, BsonDeserializationArgs)
Deserializes a BSON value into a .NET object using the supplied deserialization context and arguments.
public object Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
Parameters
contextBsonDeserializationContextThe BSON deserialization context that provides access to the reader and configuration.
argsBsonDeserializationArgsThe deserialization arguments that influence how the value is read and converted.
Returns
- object
The deserialized .NET object produced from the BSON input.
Exceptions
- NotImplementedException
Always thrown because the deserialization logic has not been implemented yet.
ReadJson(JsonReader, Type, PatientObservationAlarm?, bool, JsonSerializer)
Deserializes a JSON token into a PatientObservationAlarm instance. Returns null when the JSON token is Newtonsoft.Json.JsonToken.Null, otherwise extracts the value property from the JSON object and constructs a new alarm, falling back to a default object when the value is missing.
public override PatientObservationAlarm? ReadJson(JsonReader reader, Type objectType, PatientObservationAlarm? existingValue, bool hasExistingValue, JsonSerializer serializer)
Parameters
readerJsonReaderThe Newtonsoft.Json.JsonReader positioned at the JSON token to read.
objectTypeTypeThe type of the object being deserialized.
existingValuePatientObservationAlarmThe existing value of the object being deserialized, or
nullif none exists.hasExistingValueboolIndicates whether
existingValuecontains a value to be used during deserialization.serializerJsonSerializerThe Newtonsoft.Json.JsonSerializer used for nested object deserialization.
Returns
- PatientObservationAlarm
A PatientObservationAlarm populated from the JSON, or
nullif the JSON token is Newtonsoft.Json.JsonToken.Null.
Serialize(BsonSerializationContext, BsonSerializationArgs, object)
Serializes the specified value to BSON format using the provided serialization context and arguments.
public void Serialize(BsonSerializationContext context, BsonSerializationArgs args, object value)
Parameters
contextBsonSerializationContextThe BSON serialization context that holds the writer and configuration for the serialization operation.
argsBsonSerializationArgsThe BSON serialization arguments containing additional information that influences the serialization behavior.
valueobjectThe object to be serialized into BSON.
Exceptions
- NotImplementedException
Thrown because the method has not yet been implemented.
WriteJson(JsonWriter, object?, JsonSerializer)
Serializes the specified object to JSON, applying the Newtonsoft.Json.Converters.StringEnumConverter to the eventPhase, state, priority, and type properties, while excluding the messageTime and expired properties from the output. Does nothing when the value is null.
public void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
Parameters
writerJsonWriterThe Newtonsoft.Json.JsonWriter to which the JSON output is written.
valueobjectThe object to serialize; if null, the method performs no action.
serializerJsonSerializerThe Newtonsoft.Json.JsonSerializer used to assist with the conversion.
WriteJson(JsonWriter, PatientObservationAlarm?, JsonSerializer)
Writes the JSON representation of a PatientObservationAlarm using the specified writer and serializer.
public override void WriteJson(JsonWriter writer, PatientObservationAlarm? value, JsonSerializer serializer)
Parameters
writerJsonWriterThe JsonWriter to which the JSON output is written.
valuePatientObservationAlarmThe PatientObservationAlarm value to serialize.
serializerJsonSerializerThe JsonSerializer used during the serialization process.
Exceptions
- NotImplementedException
The method has not been implemented.