Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dependency-injection.md #2867

Merged
merged 2 commits into from Nov 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions docs/Dependency-injection.md
Expand Up @@ -21,9 +21,7 @@ var dest = mapper.Map<Source, Destination>(new Source { Value = 15 });

### Queryable Extensions

When using DI with [QueryableExtensions](Queryable-Extensions.html), remember to install the IConfigurationProvider in the IoC container.
When calling IQueryable.ProjectTo, resolve the IConfigurationProvider from the container and pass it as an argument
``` IQueryable.ProjectTo<T>(IConfigurationProvider) ```.
Starting with 8.0 you can use IMapper.ProjectTo. For older versions you need to pass the configuration to the extension method ``` IQueryable.ProjectTo<T>(IConfigurationProvider) ```.

Note that IQueryable.ProjectTo is [more limited](Queryable-Extensions.html#supported-mapping-options) than IMapper.Map, as only what is allowed by the underlying LINQ provider is supported. That means you cannot use DI with value resolvers and converters as you can with Map.

Expand Down