【发布时间】:2015-03-29 11:52:37
【问题描述】:
我正在开发一个 3 层应用程序。我使用 O/R 设计器添加了一个 Linq to SQL 表 (LEAVE)。我在业务层的类 (LeaveRecord) 中添加了以下方法从表 (LEAVE) 中检索数据。
public IQueryable<LEAVE> getLeaves()
{
dbContext db = new dbContext;
return db.LEAVEs;
}
在 UI 层,在 webform 后面的代码中,我尝试获取这样的数据:
bll.LeaveRecord leaveRecords = new bll.LeaveRecord();
var data = leaveRecords.getLeaves(); // the error message highlights this line (41) as the offender
当我运行程序时,我得到一个编译错误:
The type 'programname.dal.LEAVE' is defined in an assembly that is not referenced. You must add a reference to assembly 'programname.dal, version=1.0.0.0, Culture=neutral, PublicKeyToken=null' (Line 41).
我该如何解决这个问题?
【问题讨论】:
标签: c# linq .net-assembly 3-tier