Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to use Collections with Profile configuration?

See original GitHub issue

I’ve configured my AutoMapper with MappingProfiles inheriting from AutoMapper.Profile. How can I configure it to use Automapper.Collection without access to the IMapperConfigurationExpression interface?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

TylerCarlson1commented, Feb 19, 2021

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.

vijayathiicommented, Apr 10, 2023

Thanks @Tasteful. We need to add at the time of configuring the services.

builder.Services.AddAutoMapper(cfg => { cfg.AddCollectionMappers(); }, typeof(Program));

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found