Trying to add AutoMapper to Asp.net Core 2?

后端 未结 10 1803
我在风中等你
我在风中等你 2020-12-23 19:20

I worked on a asp.net core 1.1 project a while ago and use in projetc AutoMapper.

in asp.net core 1.1, I add services.AddAutoMapper() in startup file :<

10条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-23 20:08

    try this, works with 2.1 and up, i have not used any previous version so can't tell.

    services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());

提交回复
热议问题