IoC spring.net注入System.Type [英] IoC spring.net injecting System.Type

查看:82
本文介绍了IoC spring.net注入System.Type的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试初始化一个期望在CTOR中使用System.Type的类.

I am trying to initiate a class that is expecting a System.Type in it's CTOR.

spring.net配置文件中是否有一种方法可以实现此目的,并且最好传递spring初始化对象的类型?

Is there a way in spring.net config file to accomplish this, and preferable pass the type of a spring initialised object?

谢谢

Lihnid

推荐答案

我认为应该这样做:

<constructor-arg name="argumentname" expression="T(namespace.to.my.type, assemblyname)" />

这篇关于IoC spring.net注入System.Type的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆