Table of Contents

Method ProjectTo

Namespace
Mapperion
Assembly
Mapperion.dll

ProjectTo<TDestination>(IQueryable, MapperConfiguration)

Rewrites the query to select TDestination directly, without materialising the source.

[RequiresUnreferencedCode("Building a projection inspects types by reflection.")]
[RequiresDynamicCode("Building a projection emits code at run time.")]
public static IQueryable<TDestination> ProjectTo<TDestination>(this IQueryable source, MapperConfiguration configuration)

Parameters

source IQueryable

The query over the source type.

configuration MapperConfiguration

The configuration holding the map.

Returns

IQueryable<TDestination>

The projected query.

Type Parameters

TDestination

The type to project to.

Exceptions

ArgumentNullException

Either argument is null.

MapperConfigurationException

The map cannot be expressed as a projection.