0
我有以下設計:債務人由代理管理。每個文件都存儲爲獨立的文檔,並且使用基於id的引用。代理人與其債務人之間的每次通信均記錄爲第三個獨立文件,並以債務人身份提供參考。由此容易地創建一個索引CommunicationsByDebtor,如下:如何爲鏈接文檔創建RavenDB索引
from c in docs.Communications
select new { c.DebtorId }
但是,我怎麼定義地圖索引CommunicationsByAgent? 我已經試過這一點,但不進行編譯:
from c in docs.Communications
from d in docs.Debtors
where d.Id == c.Communication_Debtor
select new { d.AgentId }
任何意見,將不勝感激。
我得到這兩個錯誤:1)所述的非通用的方法 'Raven.Database.Linq.AbstractViewGenerator.LoadDocument(字符串)' 不能以類型參數 2)中使用類型或命名空間名稱'Debtors'無法找到(你是否缺少using指令或程序集引用?)我懷疑第一個將由我得到第二個的正確類型定義解決?我已經嘗試過債務人,債務人,債務人,docs.Debtor,docs.Debtors ... – 2013-03-08 15:36:03
行得通......必須做到這一點...從docs.Communications 讓d = LoadDocument(string.Format( 「債務人/ {0}」,c.Communication_Debtor)) select new {d.AgentId} – 2013-03-08 15:47:58
似乎你不能指定一個類型爲LoadDocument;並且它期望變量是[collectionname]/id – 2013-03-08 15:48:46