Method 'Map' in type 'AutoMapper.Data.DataReaderMapper' from assembly 'AutoMapper.Data' does not have an implementation
See original GitHub issueI’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:
- Created 8 years ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
@birjega Still looking for someone to submit a PR!
@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.