问题描述
- spring.net 泛型配置报错问题
-
我在一个类里定义了两个泛型对角如下:public class UserController : Controller { // // GET: /User/ BaseService<MDL.User_Test_T> user_test_t { set; get; } BaseService<MDL.Role_Info_T> role_info_t { set; get; } }
xml 配置如下:
<object type="WebApp.Controllers.UserController, WebApp" singleton="false" > <property name="role_info_t" ref="role_info_t" /> <property name="user_test_t" ref="user_test_t" /> </object> <object name="role_info_t" type="BLL.BaseService<MDL.Role_Info_T>, BLL" singleton="false" > </object> <object name="user_test_t" type="BLL.BaseService<MDL.User_Test_T>, BLL" singleton="false" > </object>
但运行时报对象转换错误
解决方案
解决方案二:
http://blog.csdn.net/kfarvid/article/details/6760923
时间: 2024-10-04 16:05:02