當遇到Unable to resolve service for type時,要考慮到接口方法是否已經注入:
例如:
Unable to resolve service for type 'SaasTestDemo.Application.Queries.IChannelQuery' while attempting to activate 'SaasTestDemo.API.Controllers.ChannelController'.
IChannelQuery沒有注入到startup中,需添加:


又如Unable to resolve service for type 'SaasTestDemo.Application.Queries.IChannelQuery.IDbFactory。。。。。。


浙公網安備 33010602011771號