在BLL调用IDAL接口的时候,spring 注入无效。BLL中引入了IDAL.dll。
程序运行起来没有错误。但是调用的时候,提示为实例化。
BLL的代码如下:
public AdminIDAL AdminDAL { get; set; }
public Admin CheckUserLogin(Admin admin)
{
return AdminDAL.CheckUserLogin(admin);
}
spring.xml的配置如下:
<?xml version="1.0" encoding="utf-8" ?>
<!--放容器里面的所有的节点 type属性的规范:程序集名称在内的类型全名,程序集名-->
<object type="BLL.AdminBLL,BLL" singleton="false" >
<property name="AdminIDAL" ref="adminIDAL" />
</object>
<!--配置Service-->
<object name="adminIDAL" type="IDAL.AdminIDAL,IDAL" singleton="false" >
</object>
</objects>