Class HistoricalConfigChanges
- Namespace
- adas_core.Domain.Models.MongoModels
- Assembly
- adas-core.Domain.dll
Represents a custom JSON converter for serializing and deserializing historical configuration changes.
public class HistoricalConfigChanges : JsonConverter
- Inheritance
-
JsonConverterHistoricalConfigChanges
- Inherited Members
-
JsonConverter.CanReadJsonConverter.CanWrite
- Extension Methods
Remarks
This converter extends Newtonsoft.Json.JsonConverter to provide tailored JSON conversion behavior for historical config change data.
Fields
Time
public DateTime Time
Field Value
Username
public string Username
Field Value
Properties
ConfigType
public DisplayConfigEnums.ConfigTypes? ConfigType { get; set; }
Property Value
Id
public ObjectId Id { get; set; }
Property Value
- ObjectId
NewConfig
public string NewConfig { get; set; }
Property Value
OldConfig
public string? OldConfig { get; set; }
Property Value
Methods
CanConvert(Type)
Determines whether the converter can convert the specified type. The override has not been implemented and always throws a NotImplementedException when invoked.
public override bool CanConvert(Type objectType)
Parameters
objectTypeTypeThe type to evaluate for convertibility.
Returns
Exceptions
- NotImplementedException
Thrown in all cases because the method body is not implemented.
ReadJson(JsonReader, Type, object?, JsonSerializer)
Reads the JSON representation of the object and converts it to the target type as part of a custom Newtonsoft.Json.JsonConverter. This implementation is not yet provided.
public override object ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
Parameters
readerJsonReaderThe Newtonsoft.Json.JsonReader used to read the JSON content.
objectTypeTypeThe type of the object to deserialize to.
existingValueobjectThe existing value of the object being read, or
nullif no value exists.serializerJsonSerializerThe Newtonsoft.Json.JsonSerializer used to deserialize nested objects.
Returns
- object
The deserialized object value.
Exceptions
- NotImplementedException
Always thrown because the method has not been implemented.
WriteJson(JsonWriter, object?, JsonSerializer)
Serializes the specified object to JSON, skipping output when the value is null.
The object is first projected into a Newtonsoft.Json.Linq.JObject and annotated with a string enum converter for the ConfigType property before being written to the writer.
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
Parameters
writerJsonWriterThe Newtonsoft.Json.JsonWriter that receives the serialized JSON output.
valueobjectThe object to serialize. If
null, the method does nothing.serializerJsonSerializerThe Newtonsoft.Json.JsonSerializer used during serialization.