Automapper Map.CreateMap not used anymore?

automapper-5, c#

Solution

Previously `AutoMapper` was static as per your example, it now wants to be instantiated.

Link below is by the creator of `AutoMapper` https://lostechies.com/jimmybogard/2016/01/21/removing-the-static-api-from-automapper/

Here is a snippet if that link stops working.

var config = new MapperConfiguration(cfg => {
  cfg.CreateMap<Source, Dest>();
});

var mapper = config.CreateMapper();
var source = new Source();
var dest = mapper.Map<Source, Dest>(source);

Plenty of other stackoverflow posts related to this:

Automapper says Mapper.Map is obsolete, global mappings?

AutoMapper Migrating from static API

Hope that helps.

Problem

I'm using version 5.1.1.0 of AutoMapper. Previously I was able to the following: ``` Mapper.CreateMap<SchoolYearDetail, SchoolYearDto>(); ``` But in the version 5.1.1.0 it doesn't exist anymore. Can anyone tell me what to do?

Original source

Related problems