Class JsonColumnConverter<TModel, TProvider>
Serializes a property of TModel to a JSON column. The
TProvider must be string (a text column),
JsonElement (a provider-native JSON column exposed as an element) or
JsonObject (ClickHouse's native JSON object-root transport). Named to avoid the
System.Text.Json.Serialization.JsonConverter<T> collision.
public sealed class JsonColumnConverter<TModel, TProvider> : ValueConverter<TModel, TProvider>, IPropertyValueConverter
Type Parameters
TModelThe CLR type stored in the column.
TProviderThe provider representation: string, JsonElement or JsonObject.
- Inheritance
-
ValueConverter<TModel, TProvider>JsonColumnConverter<TModel, TProvider>
- Implements
- Inherited Members
- Extension Methods
Constructors
JsonColumnConverter()
Creates a converter using the default serializer options.
public JsonColumnConverter()
JsonColumnConverter(JsonColumnOptions?)
Creates a converter using the options carried by options.
public JsonColumnConverter(JsonColumnOptions? options)
Parameters
optionsJsonColumnOptionsThe fluent JSON column options, or null for the defaults.
Methods
ConvertFromProvider(TProvider?)
Converts a provider value back to the model representation.
public override TModel? ConvertFromProvider(TProvider? provider)
Parameters
providerTProviderThe provider value, or null.
Returns
- TModel
The model value.
ConvertToProvider(TModel?)
Converts a model value to the provider representation.
public override TProvider? ConvertToProvider(TModel? model)
Parameters
modelTModelThe model value, or null.
Returns
- TProvider
The provider value.