public class AutoMapperBootstrap : AutoMapper.Profile
{
protected override void Configure()
{
//ReplaceMemberName("Z", "A");
//CreateMap<Source, Destination>();
}
public override string ProfileName
{
get { return this.GetType().Name; }
}
}
I have this AutoMapperBootstrap class in the App_Start folder of my MVC Application.
In "configure" method it is giving compiler error- "No Suitable method to override", I am getting the error for configure method and not for ProfileName
I have seen many examples in the StackOverflow overriding configure method of the profile in custom Automapper profile.
But why I am getting this compiler error.
Please let me know what is the mistake I am making??
or is it the latest version of Automapper does not have this Configure method to be overridden.
Note: I have downloaded latest Automapper version 6.1.1.0 from Nuget into my application.
Newer versions of AutoMapper have a different method for setting up a profile. I am using the method described here to set up automating in a class library in a .net project.
namespace Project.Helpers
{
public class NewMapperProfile : Profile
{
public NewMapperProfile()
{
CreateMap<ClassA, ClassB>();
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With