我们的团队已经在使用 .NET 4、NHibernate 3.0 和 SharpArchitecture 1.9.5 开展项目。
问题是我们无法让存储库工作并获取数据。我们只是想通过一个 Site 类来解决这个问题。
站点表充满了站点。
Site Domain类和Site表是链接在一起的,因为FluentNHibernate生成的映射文件都可以。
我们知道数据库连接是有效的,因为我们一直在使用 SharpArch 源代码调试我们的应用程序,并且 LinqRepository< Site > 中的 Session 对象的连接状态设置为“打开”。
我们有一个 SiteTasks 在内置 SharpArchitecture ILinqRepository< Site > 的帮助下实现了 GetAllSites 方法:
public IList<Site> GetAllSites()
{
IQueryable<Site> findAll = this.Repository.FindAll();
return findAll.ToList();
}
不幸的是,findAll变量是空的,当我们稍后尝试将其转换为列表时会抛出该错误:
System.ExecutionEngineException was unhandled Message=Exception of type 'System.ExecutionEngineException' was thrown.
任何想法?
谢谢你。