Table of Contents

Struct TypeMappingStore

Namespace
LfrlAnvil.Mapping.Internal
Assembly
LfrlAnvil.Mapping.dll

Represents a container for delegates used for type mapping.

public readonly struct TypeMappingStore
Inherited Members

Properties

FastDelegate

Fast delegate. Used when both source and destination types are known.

public Delegate FastDelegate { get; }

Property Value

Delegate

SlowDelegate

Slow delegate. Used when either source or destination type is unknown.

public Delegate SlowDelegate { get; }

Property Value

Delegate

Methods

GetDelegate()

Returns the SlowDelegate.

[Pure]
public Func<object, ITypeMapper, object> GetDelegate()

Returns

Func<object, ITypeMapper, object>

SlowDelegate.

Exceptions

InvalidCastException

When SlowDelegate is not an object => object mapping definition.

GetDelegate<TDestination>()

Returns the SlowDelegate.

[Pure]
public Func<object, ITypeMapper, TDestination> GetDelegate<TDestination>()

Returns

Func<object, ITypeMapper, TDestination>

SlowDelegate.

Type Parameters

TDestination

Destination type.

Exceptions

InvalidCastException

When SlowDelegate is not an object => TDestination mapping definition.

GetDelegate<TSource, TDestination>()

Returns the FastDelegate.

[Pure]
public Func<TSource, ITypeMapper, TDestination> GetDelegate<TSource, TDestination>()

Returns

Func<TSource, ITypeMapper, TDestination>

FastDelegate.

Type Parameters

TSource

Source type.

TDestination

Destination type.

Exceptions

InvalidCastException

When FastDelegate is not a TSource => TDestination mapping definition.