2013-04-17 122 views
0

我有一個C#Windows應用程序運行在我的本地連接到Intranet的盒子上。我使用nHibernate作爲ORM。我們在我們的網站上使用相同的nHibernate ORM設置。該網站使用nHibernate ORM適當地執行所有CRUD操作。但是,我的Windows應用程序不檢索任何數據。會話被初始化,連接被連接並且數據庫有數據。調用.FindFirst()或.FindAllProposals()時沒有錯誤,只是沒有返回數據。這裏的資源庫對象的快照,它的連接狀態:C#NHibernate連接但沒有返回數據,也沒有錯誤

enter image description here

下面是倉庫類的代碼片段:

public class ProposalRepository : NHRepository<Proposal> 
{ 
    /// <summary> 
    /// Queries the database for all Proposals. 
    /// </summary> 
    /// <returns>A list of Proposals sorted newest first.</returns> 
    public IList<Proposal> FindAllProposals() 
    { 
     return FindAll(DetachedCriteria.For<Proposal>(), 
          new Order("CreateDate", false)).ToList<Proposal>(); 
    } 
} 

它出現相連,積極,開放的。任何想法爲什麼沒有數據被返回?

+0

你沒有張貼'FindAll'方法的代碼... –

+0

@Johnny .....的FindAll是在基類Rhino.Commons.RepositoryImplBase ,我們的NHRepository從繼承的默認方法 – MikeTWebb

回答

2

您必須更改hbm.xml文件的構建操作。 enter image description here

相關問題