Ali Mukhtar Ali Mukhtar - 2 months ago 79
ASP.NET (C#) Question

Auto mapper version 5 no definition for Mapper.Createmap

I'am currently following a tutorial of ASP.NET MVC in which instructor use auto mapper version 4.x and now i have only option of version 5.

When I create a mapping profile in which i get an error

Mapper
does not contain a definition for
CreateMap
:

You can see image here

I've attached all pictures of :
My Mapping Profile.
My Global.asax.cs.
/api/customer
is working fine.
/api/movies
is not working.

Is there something wrong i did or missed something?
Here's the link of my images

Answer

CreateMap is an instance method of the base class Profile

Just call

public MappingProfile()
{
   CreateMap<A,B>() //...
}