Table of Contents

Interface IGenericInfoProvider

Namespace
LinqToDB.Expressions
Assembly
linq2db.dll

Generic conversions provider. Implementation class must be generic, as type parameters will be used for conversion initialization in SetInfo(MappingSchema) method.

// this conversion provider adds conversion from IEnumerable<T> to ImmutableList<T> for specific T type parameter
class EnumerableToImmutableListConvertProvider<T> : IGenericInfoProvider
{
public void SetInfo(MappingSchema mappingSchema)
{
mappingSchema.SetConvertExpression<IEnumerable<T>,ImmutableList<T>>(
t => ImmutableList.Create(t.ToArray()));
}
}
SetGenericConvertProvider(Type) for more details.

public interface IGenericInfoProvider
Extension Methods

Methods

SetInfo(MappingSchema)

Implementation should use this method to provide conversions for generic types with type parameters, used to instantiate instance of current class.

void SetInfo(MappingSchema mappingSchema)

Parameters

mappingSchema MappingSchema

Mapping schema, to which conversions should be added.