question-mark
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.

AutoMapper 5 - AutoScanning and integration with ABP...

See original GitHub issue

Moving from ABP 0.9.7/ AutoMapper 4.21 to ABP 1.x / AutoMapper 5.1.x

We want to use the AutoMapper scanning feature to pick up all our profiles viz:

Mapper.Initialize(cfg => { cfg.AddProfiles("MyNameSpace.Assembly1", "MyOtherNameSpace.Assembly1", ....); 

So I am guessing I put this in the application module PostInitialize as per #1311.

  1. Is there anything else I need to do?
  2. How does ABP integrate with this considering the single call to Initialize() which spins up AutoMapper?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
hikalkancommented, Nov 10, 2016

If ABP is initialized in your project, then do all mappings inside Configuration.Modules.AbpAutoMapper().Configurators.Add(...). You can call other non-abp dlls from here, no problem. If ABP is not initialized, then no problem, it will not call Mapper.Initialize at all.

0reactions
hikalkancommented, Apr 24, 2017

I’m not using AssertConfigurationIsValid since it has very strict rules and enforces custom mappings. If you want to use it, I suggest you to do it in your PostInitialize method:

IocManager.Resolve<IMapper>().ConfigurationProvider.AssertConfigurationIsValid();
Read more comments on GitHub >

github_iconTop Results From Across the Web

Object To Object Mapping | Documentation Center | ABP.IO
ABP provides abstractions for object to object mapping and has an integration package to use AutoMapper as the object mapper.
Read more >
Object To Object Mapping (and AutoMapper Integration)
The Abp.AutoMapper module defines a mapping to convert LocalizableString (or ILocalizableString) objects to string objects. It makes the conversion using ...
Read more >
c# - Abp.io AutoMapper extension ...
Using the abp.io framework on their implementation of AutoMapper which is integrated with the framework I'm having some issues mapping ...
Read more >
Configuration
Configuring visibility​​ By default, AutoMapper only recognizes public members. It can map to private setters, but will skip internal/private methods and ...
Read more >
How to configure AutoMapper for another application #4831
The Abp.AutoMapper NuGet package module implements the IObjectMapper and provides additional features. Installation. First, install the Abp.
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 Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found