public static OutputPipe <RestEntityCollection> BuildMappingForCollection <TInput, TOutput>( this IOutputPipe <IQueryable <TInput> > pipe, Func <IMappingBuilder <TInput>, Func <TInput, TOutput> > builder) where TInput : class where TOutput : class { var transformerBuilder = pipe.GetService <IMappingBuilder <TInput> >(); return(pipe.MapToRestCollection(builder(transformerBuilder))); }
public static OutputPipe <RestEntityCollection> UseMapperForCollection <TInput, TOutput>( this IOutputPipe <IQueryable <TInput> > pipe, Func <IMapperFactory <TInput>, IMapper <TInput, TOutput> > selection) where TInput : class where TOutput : class { var transformer = pipe.GetService <IMapperFactory <TInput> >(); return(pipe.MapToRestCollection(i => selection(transformer).Map(i))); }