Class TypeWithObjectPropertiesJsonConverter<TTarget>

Namespace
Cratis.Json
Assembly
Cratis.Fundamentals.dll

Represents a JsonConverter<T> that can convert types with properties that are of type object.

public abstract class TypeWithObjectPropertiesJsonConverter<TTarget> : JsonConverter<TTarget> where TTarget : class

Type Parameters

TTarget

Type of target the converter is for.

Inheritance
JsonConverter<TTarget>
TypeWithObjectPropertiesJsonConverter<TTarget>
Inherited Members
Extension Methods

Constructors

TypeWithObjectPropertiesJsonConverter()

protected TypeWithObjectPropertiesJsonConverter()

Properties

ObjectProperties

Get the properties that are of type object.

protected abstract IEnumerable<string> ObjectProperties { get; }

Property Value

IEnumerable<string>

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "Type resolution and JSON deserialization use types stored in the JSON payload that are preserved at startup.")]
[UnconditionalSuppressMessage("Trimming", "IL2057", Justification = "The type string in the JSON payload is expected to resolve to a type preserved by the application.")]
[UnconditionalSuppressMessage("Trimming", "IL2070", Justification = "Properties set after deserialization are well-known named properties preserved by callers.")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "Type resolution and JSON deserialization use types stored in the JSON payload that are safe for AOT.")]
public override TTarget? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader
typeToConvert Type
options JsonSerializerOptions

Returns

TTarget

Write(Utf8JsonWriter, TTarget, JsonSerializerOptions)

[UnconditionalSuppressMessage("Trimming", "IL2026", Justification = "JSON serialization uses types stored in the JSON payload that are preserved at startup.")]
[UnconditionalSuppressMessage("Trimming", "IL2075", Justification = "The runtime type's properties are accessed via well-known property names; the type is preserved by callers.")]
[UnconditionalSuppressMessage("AOT", "IL3050", Justification = "JSON serialization uses types stored in the JSON payload that are safe for AOT.")]
public override void Write(Utf8JsonWriter writer, TTarget value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter
value TTarget
options JsonSerializerOptions