2009-09-15 39 views
2

我在Vici.CoolStorage中遇到了一個異常'。在.List()方法上使用以下過濾器時,無法強制轉換'System.String'類型的對象以鍵入'QueryExpression' >事件 - - 資源=多對一關係(資源屬性)Vici.CoolStorage:過濾器與ManyToOne和ManyToMany的關係

- >資源 - 團隊=多對多關係,多=真(CSList團隊屬性)

Event.List("has(Resource where has(Teams where TeamID = @TeamID))", 
       "@TeamID", teamID); 

:我Event類的想要檢索屬於該資源的所有事件指定的團隊(teamID)。這是Vici.CoolStorage過濾器語法中的可能嗎?

ps。 teamID = Guid

回答

1

has()函數只能與* ToMany關係一起使用。我認爲你的意思是這樣的:

我想你想選擇所有記錄有相關的資源beloning到特定的團隊?

這可能是你在找什麼:

Event.List("has(Resource.Teams where TeamID = @TeamID))", 
      "@TeamID", teamID);