Class SingleOrArrayJsonConverter<T>
Ensures that objects are consistently cast as an array even if only a single object is passed.
Inheritance
System.Text.Json.Serialization.JsonConverter
SingleOrArrayJsonConverter<T>
Namespace: Den.Dev.Grunt.Converters
Assembly: Den.Dev.Grunt.dll
Syntax
[[System.Runtime.CompilerServices.Nullable(new System.Byte[] { 0, 1, 1 })]]
[[System.Runtime.CompilerServices.NullableContext(1)]]
public class SingleOrArrayJsonConverter<T> : System.Text.Json.Serialization.JsonConverter<System.Collections.Generic.List<T>>
Type Parameters
Name | Description |
---|---|
T | Type to be cast to. |
Constructors
Name | Description |
---|---|
SingleOrArrayJsonConverter<T>() |
Methods
Name | Description |
---|---|
CanConvert(Type) | Determines whether the type can be properly converted to the target type. |
Read(Utf8JsonReader, Type, JsonSerializerOptions) | Read the entity. |
Write(Utf8JsonWriter, List<T>, JsonSerializerOptions) | Writes the target type data to a writer. |