Table of Contents

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 JsonSerializerOptions

The 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

JsonTypeInfo<bool>

CompleteModel

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<CompleteModel> CompleteModel { get; }

Property Value

JsonTypeInfo<CompleteModel>

Default

The default JsonSerializerContext associated with a default JsonSerializerOptions instance.

public static MediatorJsonContext Default { get; }

Property Value

MediatorJsonContext

DispatchRequest

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<DispatchRequest> DispatchRequest { get; }

Property Value

JsonTypeInfo<DispatchRequest>

EntityFilter

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<EntityFilter> EntityFilter { get; }

Property Value

JsonTypeInfo<EntityFilter>

EntityQuery

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<EntityQuery> EntityQuery { get; }

Property Value

JsonTypeInfo<EntityQuery>

EntitySelect

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<EntitySelect> EntitySelect { get; }

Property Value

JsonTypeInfo<EntitySelect>

EntitySort

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<EntitySort> EntitySort { get; }

Property Value

JsonTypeInfo<EntitySort>

GeneratedSerializerOptions

The source-generated options associated with this context.

protected override JsonSerializerOptions? GeneratedSerializerOptions { get; }

Property Value

JsonSerializerOptions

IDictionaryStringObject

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<IDictionary<string, object>> IDictionaryStringObject { get; }

Property Value

JsonTypeInfo<IDictionary<string, object>>

IDictionaryStringStringArray

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<IDictionary<string, string[]>> IDictionaryStringStringArray { get; }

Property Value

JsonTypeInfo<IDictionary<string, string[]>>

IListEntitySort

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<IList<EntitySort>> IListEntitySort { get; }

Property Value

JsonTypeInfo<IList<EntitySort>>

IRequest

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<IRequest> IRequest { get; }

Property Value

JsonTypeInfo<IRequest>

Int32

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<int> Int32 { get; }

Property Value

JsonTypeInfo<int>

NullableInt32

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<int?> NullableInt32 { get; }

Property Value

JsonTypeInfo<int?>

Object

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<object> Object { get; }

Property Value

JsonTypeInfo<object>

ProblemDetails

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<ProblemDetails> ProblemDetails { get; }

Property Value

JsonTypeInfo<ProblemDetails>

String

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<string> String { get; }

Property Value

JsonTypeInfo<string>

StringArray

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<string[]> StringArray { get; }

Property Value

JsonTypeInfo<string[]>

ValidationResult

Defines the source generated JSON serialization contract metadata for a given type.

public JsonTypeInfo<ValidationResult> ValidationResult { get; }

Property Value

JsonTypeInfo<ValidationResult>

Methods

GetTypeInfo(Type)

Gets metadata for the specified type.

public override JsonTypeInfo? GetTypeInfo(Type type)

Parameters

type Type

The type to fetch metadata for.

Returns

JsonTypeInfo

The metadata for the specified type, or null if the context has no metadata for the type.