Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Dependency injection net如何传递System.Type作为参数_Dependency Injection_Spring.net_System.type - Fatal编程技术网

Dependency injection net如何传递System.Type作为参数

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"

如何在spring.NETDI中传递其他类类型?我无法通过文档或我的实现来理解这一点? 尝试执行以下操作,但出现异常..:

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" />