How to use Collections with Profile configuration?
See original GitHub issueI’ve configured my AutoMapper with MappingProfile
s inheriting from AutoMapper.Profile
. How can I configure it to use Automapper.Collection
without access to the IMapperConfigurationExpression
interface?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
8 Setting Up Collections Profiles
To set up additional profiles, you complete two sets of tasks: Define names and descriptions for the profiles by using Collections Configuration. When...
Read more >Create collections - Configuration Manager
Create collections in Configuration Manager to more easily manage groups of users and devices.
Read more >Access and edit collection configuration
Open CONTENTdm Administration and select the server tab. Click collections. Click the configure link next to a collection. Collection profile ...
Read more >Editing Collections with Configuration Editor
Select the profiles entry within Configuration Editor and click the … · In the Actions Task Pane on the right hand side, click...
Read more >Custom Configuration for app.config - collections of sections?
Change Profile from a ConfigurationSection to a ConfigurationElement, then make a ConfigurationSection Profiles that contains a collection ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can’t. It needs the
IMapperConfigurationExpression
to inject the feature that will allow for collection mapping before any configuration starts. This needs to be done at the top most level, and shouldn’t be done on the profile level. You should add collection mappers then add custom profiles.Thanks @Tasteful. We need to add at the time of configuring the services.
builder.Services.AddAutoMapper(cfg => { cfg.AddCollectionMappers(); }, typeof(Program));