另有20分等你拿.我该怎样应用接口呢??????昨天的问题呀!!!!!!!!!
http://community.csdn.net/Expert/topic/4901/4901289.xml?temp=.2712824
namespace IDAL
{
public interface IAccount
{
void Insert(AccountInfo acc);
}
}
namespace Bll
{
public class Account
{
public void Insert(AccountInfo account)
{
IAccount dal; // 这里是不对的
IAccount dal = new IAccount() //不对
IAccount dal = new DAL.Account() // 不对
dal.Insert(account);
}
}
}
我该怎样应用接口呢? 在petshop中,他调用了程序集,引用了SQLServerDAL中的Account类,这个类是继承了接口IDAL的.在这里也就是在BLL中我该怎么做呢? 谢谢了!