spring.net如何将System.Type作为参数传递

时间:2013-10-22 06:38:06

标签: dependency-injection spring.net system.type

public class MyClass{

public MyClass(System.Type type)
{
// do whatever
}
}

如何在spring.net DI中传递SomeOtherClass类型?我无法通过文档或我的实现来解决这个问题? 试图在下面做,但有例外..:

...
  <constructor-arg index="0" value="SomeOtherClass" type="System.Type"/> 
..

1 个答案:

答案 0 :(得分:2)

<constructor-arg index="0" value="MyNamespace.SomeOtherClass, MyAssembly" />