小编Rit*_*jak的帖子

覆盖void Automapper Profile中的Configure(),给出编译错误"AutoMapperBootstrap.Configure()":找不到合适的方法来覆盖"

public class AutoMapperBootstrap : AutoMapper.Profile
{
    protected override void Configure()
    {
        //ReplaceMemberName("Z", "A");
        //CreateMap<Source, Destination>(); 
    }
    public override string ProfileName
    {
        get { return this.GetType().Name; }
    }
}
Run Code Online (Sandbox Code Playgroud)

我在我的MVC应用程序的App_Start文件夹中有这个AutoMapperBootstrap类.

在"configure"方法中,它给出了编译器错误 - "No Suitable method to override",我得到的是configure方法的错误而不是ProfileName的错误

我在自定义Automapper配置文件中的StackOverflow覆盖配置文件的配置方法中看到了很多示例.

但是为什么我得到这个编译错误.

请让我知道我犯的错误是什么?

或者是最新版本的Automapper没有覆盖此Configure方法.

注意:我已将Nuget的最新Automapper版本6.1.1.0下载到我的应用程序中.

profile automapper

7
推荐指数
1
解决办法
2746
查看次数

标签 统计

automapper ×1

profile ×1