Mapper not initialized. Call Initialize with appropriate configuration. If you are trying to use mapper instances through a container or otherwise, make sure you do not have any calls to the static Mapper.Map methods, and if you're using ProjectTo or UseAsDataSource extension methods, make sure you pass in the appropriate IConfigurationProvider instance.
这个报出来的错误具体是指什么问题?
AutoMapper
未初始化而使用了Mapper.Map<>
,在 Startup
中的ConfigureService
里面注册初始化问题就解决了。