.net core 如何在扩展方法中使用Automapper 10?

.net core 如何在扩展方法中使用Automapper 10?,.net-core,automapper,.net Core,Automapper,我们在静态类和扩展方法中使用了旧版本的Automapper public static Account GetAccountDomain(this AccountViewModel viewModel) { return AutoMapper.Mapper.Map<AccountViewModel, Account>(viewModel); } 在点网核心和automapper 10中我们能做些什么?automapper已经消除了静态,以获得更好

我们在静态类和扩展方法中使用了旧版本的Automapper

  public static Account GetAccountDomain(this AccountViewModel viewModel)
    {
        return AutoMapper.Mapper.Map<AccountViewModel, Account>(viewModel);
    }

在点网核心和automapper 10中我们能做些什么?

automapper已经消除了静态,以获得更好的性能。它应该与您需要的所有框架中的DI模式(IMapper)一起使用。

您尝试了什么,遇到了什么问题?我们不能在dot net core 3.1中的Automapper新版本中使用此结构
  accountViewModel.GetAccountDomain();