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.

Method 'Map' in type 'AutoMapper.Data.DataReaderMapper' from assembly 'AutoMapper.Data' does not have an implementation

See original GitHub issue

I’m trying to map DataTable having customer details to List<Customer>. Here is the configuration I put

MapperConfiguration config = new MapperConfiguration(cfg => { MapperRegistry.Mappers.Add(new DataReaderMapper() { YieldReturnEnabled = true }); cfg.CreateMap<IDataReader, Customer>(); //Remaining Config cfg.CreateMap<>(); }

The above configuration is getting initialized in App_Start method. Below is the exception I’m getting it. I didn’t understand what I’m missing here. If I remove below two lines from the above configuration, everything works fine.

MapperRegistry.Mappers.Add(new DataReaderMapper() { YieldReturnEnabled = true }); cfg.CreateMap<IDataReader, Customer>();

Exception Message:

Method ‘Map’ in type ‘AutoMapper.Data.DataReaderMapper’ from assembly ‘AutoMapper.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null’ does not have an implementation.

This is how I’m calling.

mapper.Map<IDataReader, List<Customer>>(dt.CreateDataReader());

Documentation says to use Mapper.Initialize() but this method seems deprecated in the latest AutoMapper.

Please let me know how to use DataReaderMapper with the latest AutoMapper approach. Paste few working lines of code on how to use it.

Thanks, Tulasi.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jbogardcommented, Apr 13, 2016

@birjega Still looking for someone to submit a PR!

0reactions
jbogardcommented, Jul 18, 2016

@johntacke Still waiting for someone to update it to 5.0.2! No PRs unfortunately 😦

I don’t use this library, so someone who actually uses it needs to step up and update it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Method 'IsMatch' in type 'AutoMapper.Data. ...
Method 'IsMatch' in type 'AutoMapper.Data.DataReaderMapper' from assembly 'AutoMapper.Data, Version=1.0.0.0 does not have an implementation.".
Read more >
Configuration
A good way to organize your mapping configurations is with profiles. Create classes that inherit from Profile and put the configuration in the...
Read more >
Getting Started with AutoMapper in ASP.NET Core
we are going to learn how to use the AutoMapper in a .NET Core application. We will look into what the AutoMapper is...
Read more >
Add AutoMapper to .Net 6
Hi, I get this error: The type or namespace name 'Result<>' could not be found (are you missing a using directive or an...
Read more >
The reasons behind why I don't use AutoMapper.
I've encountered cases when AutoMapper transforms simple thing like mapping values from object to other into a really complex problem, which ...
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