例如,我在类型的构造函数中使用一个参数注册了类C1 System.Type.我有另一个类(C2),注入参数类型为C1.我希望typeof(C2)在C1构造函数中自动接收.有可能吗?
示例代码:
public class C1
{
public C1(Type type) {}
// ...
}
public class C2
{
public C2(C1 c1) {}
// ...
}
// Registration
containerBuilder.Register(???);
containerBuilder.Register<C2>();
Run Code Online (Sandbox Code Playgroud)