开发者

NHibernate 3.0 Session.Query Method

Our team already works on a project with .NET 4, NHibernate 3.0 and SharpArchitecture 1.9.5.

The problem is we can't get the repositories to work and fetch the data. We just want to get this right with a Site class for starters.

The Site table is full of sites.

The Site Domain class and the Site table are linked together because the mapping files generated by FluentNHibernate are all right.

We know that the database connection is valid because we have been debugging our app with the SharpArch source code and the Session object in the LinqRepository<Site> has its Connection state set to "Open".

We have a SiteTasks implementing a GetAllSites method with the help of the built-in SharpArchitecture ILinqRepository<Site>:

public IList<Site> GetAllSites()
    {
        IQueryable<Site> findAll = this.Repository.FindAll();
        return findAll.ToList();
    }

Unfortunately, the findAll variable is empty and throws that error when we try to cast it to a list later on:

System.ExecutionEngineException wa开发者_运维问答s unhandled  Message=Exception of type 'System.ExecutionEngineException' was thrown.

Any idea?

Thank you.


ExecutionEngineException? The MSDN description of this exception is "The exception that is thrown when there is an internal error in the execution engine of the common language runtime.".

Seems to be a bigger problem with your machine and not something specific to your code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜