4

I am using IMapper which is configured as follows:

var mapperConfig = new MapperConfiguration(cfg => {
      cfg.CreateMap<IAitoeRedCell, VigilantSingleProcessViewModel>();
      cfg.CreateMap<MailSettingsViewModel1, IEmail>();
    });

NInjectKernel.Bind<IMapper>().ToConstant(mapperConfig.CreateMapper());

And this is injected into as follows.

public MailSettingsViewModel(IEmailService emailService, IMapper mapper) {...}

But now for unit tests I see on the net that pple are refering to IMappingEngine.

I have a few questions.

  1. What is the namespace of IMappingEngine?

    I checked out the following namespaces, but I did not find it.

    using AutoMapper;
    using AutoMapper.Configuration;
    using AutoMapper.Configuration.Conventions;
    using AutoMapper.Execution;
    using AutoMapper.Mappers;
    using AutoMapper.QueryableExtensions;
    using AutoMapper.QueryableExtensions.Impl;
    

    Am I missing some other nuget package? I found only one - AutoMapper :(

  2. More importantly I want to know differences and which to use when? Can someone please share links with some simple code samples.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
VivekDev
  • 20,868
  • 27
  • 132
  • 202

1 Answers1

1

I also spent time on this. The following link helped me to use IMapper instead of IMappingEngine.

IMappingEngine not recognized in AutoMapper 5.1.1

Mosharaf Hossain
  • 1,439
  • 12
  • 7