有没有一种方法可以使用类似于 .AsImplementedInterfaces() 的 JSON 配置在 Autofac 中为组件注册所有接口

Is there a way of registering all interfaces in Autofac for a component using JSON configuration similar to .AsImplementedInterfaces()

是否可以通过 JSON 注册一些组件,就像使用 .AsImplementedInterfaces() 注册组件一样?或者模块是唯一的方法吗?

谢谢。

不幸的是,不,没有办法通过配置来做 AsImplementedInterfaces 等效。在这种情况下,模块可能是正确的方法。配置实际上更多的是“我需要交换一两件东西,准确地概述这些东西是什么不会有问题。”它绝对不是为了取代基于代码的注册或在功能上与基于代码的注册相媲美。