Share via


BoolToTwoValuesConverter<TProvider> Class

Definition

Converts Boolean values to and from two different values.

public class BoolToTwoValuesConverter<TProvider> : Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter<bool,TProvider>
type BoolToTwoValuesConverter<'Provider> = class
    inherit ValueConverter<bool, 'Provider>
Public Class BoolToTwoValuesConverter(Of TProvider)
Inherits ValueConverter(Of Boolean, TProvider)

Type Parameters

TProvider
Inheritance
BoolToTwoValuesConverter<TProvider>
Derived

Remarks

See EF Core value converters for more information and examples.

Constructors

BoolToTwoValuesConverter<TProvider>(TProvider, TProvider, Expression<Func<TProvider,Boolean>>, ConverterMappingHints)

Creates a new instance of this converter that will convert a false false to one value and a true to another.

Properties

ConvertFromProvider

Gets the function to convert objects when reading data from the store, setup to handle nulls, boxing, and non-exact matches of simple types.

(Inherited from ValueConverter<TModel,TProvider>)
ConvertFromProviderExpression

Gets the expression to convert objects when reading data from the store, exactly as supplied and may not handle nulls, boxing, and non-exact matches of simple types.

(Inherited from ValueConverter<TModel,TProvider>)
ConvertFromProviderTyped

Gets the function to convert objects when reading data from the store.

(Inherited from ValueConverter<TModel,TProvider>)
ConvertsNulls

If true, then the nulls will be passed to the converter for conversion. Otherwise null values always remain null.

(Inherited from ValueConverter)
ConvertToProvider

Gets the function to convert objects when writing data to the store, setup to handle nulls, boxing, and non-exact matches of simple types.

(Inherited from ValueConverter<TModel,TProvider>)
ConvertToProviderExpression

Gets the expression to convert objects when writing data to the store, exactly as supplied and may not handle nulls, boxing, and non-exact matches of simple types.

(Inherited from ValueConverter<TModel,TProvider>)
ConvertToProviderTyped

Gets the function to convert objects when writing data to the store.

(Inherited from ValueConverter<TModel,TProvider>)
MappingHints

Hints that can be used by the ITypeMappingSource to create data types with appropriate facets for the converted data.

(Inherited from ValueConverter)
ModelClrType

The CLR type used in the EF model.

(Inherited from ValueConverter<TModel,TProvider>)
ProviderClrType

The CLR type used when reading and writing from the store.

(Inherited from ValueConverter<TModel,TProvider>)

Methods

ComposeWith(ValueConverter)

Composes another ValueConverter instance with this one such that the result of the first conversion is used as the input to the second conversion.

(Inherited from ValueConverter)

Applies to