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
sourceIQueryableThe query over the source type.
configurationMapperConfigurationThe configuration holding the map.
Returns
- IQueryable<TDestination>
The projected query.
Type Parameters
TDestinationThe type to project to.
Exceptions
- ArgumentNullException
Either argument is null.
- MapperConfigurationException
The map cannot be expressed as a projection.