Table of Contents

Interface IValueConverterSelector

Namespace
Microsoft.EntityFrameworkCore.Storage.ValueConversion
Assembly
Microsoft.EntityFrameworkCore.dll

A registry of ValueConverterInfo that can be used to find the preferred converter to use to convert to and from a given model type to a type that the database provider supports.

public interface IValueConverterSelector

Remarks

The service lifetime is Singleton. This means a single instance is used by many DbContext instances. The implementation must be thread-safe. This service cannot depend on services registered as Scoped.

See EF Core value converters for more information and examples.

Methods

Select(Type, Type?)

Returns the list of ValueConverterInfo instances that can be used to convert the given model type. Converters nearer the front of the list should be used in preference to converters nearer the end.

IEnumerable<ValueConverterInfo> Select(Type modelClrType, Type? providerClrType = null)

Parameters

modelClrType Type

The type for which a converter is needed.

providerClrType Type

The store type to target, or null for any.

Returns

IEnumerable<ValueConverterInfo>

The converters available.

Remarks

See EF Core value converters for more information and examples.