Dependency injection net如何传递System.Type作为参数
如何在spring.NETDI中传递其他类类型?我无法通过文档或我的实现来理解这一点? 尝试执行以下操作,但出现异常..:Dependency injection net如何传递System.Type作为参数,dependency-injection,spring.net,system.type,Dependency Injection,Spring.net,System.type,如何在spring.NETDI中传递其他类类型?我无法通过文档或我的实现来理解这一点? 尝试执行以下操作,但出现异常..: public class MyClass{ public MyClass(System.Type type) { // do whatever } } 。。。 .. 这将给出类本身,而不是类的类型?如果您想要调用类型的名称,这将100%返回类的类型。 ... <constructor-arg index="0" value="SomeOtherClass"
public class MyClass{
public MyClass(System.Type type)
{
// do whatever
}
}
。。。
..
这将给出类本身,而不是类的类型?如果您想要调用类型的名称,这将100%返回类的类型。
...
<constructor-arg index="0" value="SomeOtherClass" type="System.Type"/>
..
<constructor-arg index="0" value="MyNamespace.SomeOtherClass, MyAssembly" />