Class MediatorJsonContext
- Namespace
- Arbiter.CommandQuery
- Assembly
- Arbiter.CommandQuery.dll
Provides a JsonSerializerContext for source generation of JSON serialization metadata for types used in the Arbiter Command/Query pipeline.
[JsonSerializable(typeof(CompleteModel))]
[JsonSerializable(typeof(DispatchRequest))]
[JsonSerializable(typeof(EntityFilter))]
[JsonSerializable(typeof(EntityQuery))]
[JsonSerializable(typeof(EntitySelect))]
[JsonSerializable(typeof(EntitySort))]
[JsonSerializable(typeof(ProblemDetails))]
[JsonSerializable(typeof(ValidationResult))]
public class MediatorJsonContext : JsonSerializerContext, IJsonTypeInfoResolver
- Inheritance
-
MediatorJsonContext
- Implements
- Inherited Members
Remarks
This context enables efficient serialization and deserialization of DispatchRequest and ProblemDetails types in Blazor WebAssembly and other .NET applications.
Constructors
MediatorJsonContext()
public MediatorJsonContext()
MediatorJsonContext(JsonSerializerOptions)
Creates an instance of JsonSerializerContext and binds it with the indicated JsonSerializerOptions.
public MediatorJsonContext(JsonSerializerOptions options)
Parameters
options
JsonSerializerOptionsThe run time provided options for the context instance.
Properties
Boolean
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<bool> Boolean { get; }
Property Value
CompleteModel
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<CompleteModel> CompleteModel { get; }
Property Value
Default
The default JsonSerializerContext associated with a default JsonSerializerOptions instance.
public static MediatorJsonContext Default { get; }
Property Value
DispatchRequest
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<DispatchRequest> DispatchRequest { get; }
Property Value
EntityFilter
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<EntityFilter> EntityFilter { get; }
Property Value
EntityQuery
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<EntityQuery> EntityQuery { get; }
Property Value
EntitySelect
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<EntitySelect> EntitySelect { get; }
Property Value
EntitySort
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<EntitySort> EntitySort { get; }
Property Value
GeneratedSerializerOptions
The source-generated options associated with this context.
protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }
Property Value
IDictionaryStringObject
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<IDictionary<string, object>> IDictionaryStringObject { get; }
Property Value
IDictionaryStringStringArray
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<IDictionary<string, string[]>> IDictionaryStringStringArray { get; }
Property Value
IListEntitySort
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<IList<EntitySort>> IListEntitySort { get; }
Property Value
IRequest
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<IRequest> IRequest { get; }
Property Value
Int32
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<int> Int32 { get; }
Property Value
NullableInt32
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<int?> NullableInt32 { get; }
Property Value
Object
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<object> Object { get; }
Property Value
ProblemDetails
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<ProblemDetails> ProblemDetails { get; }
Property Value
String
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<string> String { get; }
Property Value
StringArray
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<string[]> StringArray { get; }
Property Value
ValidationResult
Defines the source generated JSON serialization contract metadata for a given type.
public JsonTypeInfo<ValidationResult> ValidationResult { get; }
Property Value
Methods
GetTypeInfo(Type)
Gets metadata for the specified type.
public override JsonTypeInfo? GetTypeInfo(Type type)
Parameters
type
TypeThe type to fetch metadata for.
Returns
- JsonTypeInfo
The metadata for the specified type, or null if the context has no metadata for the type.