这里有什么问题?会话已关闭 - Castle ActiveRecord
public IQueryable<Customer> GetAllCustomers()
{
using (SessionScope scope = new SessionScope())
{
return scope.AsQueryable<Customer>();
}
}
var result = from x in GetAllCustomers() select x;
Assert.Greater(result.Count(), 0);
System.ObjectDisposedException: 会话关闭!对象名称: 'ISession'。
这个帖子并没有帮助我: Castle ActiveRecord error "Session is closed"
感谢帕夫洛。你知道是否有可能检测到查询不再被使用吗? – Eduardo 2011-02-24 16:48:47