0
我不知道是什麼問題,但我必須做錯了,因爲索引是空的,即使我刪除where b.Status == ...
行。 任何想法?RavenDB嵌套字典屬性索引
public class Bookings_ToBeScheduled : AbstractIndexCreationTask<Inspection, BookingRequest>
{
public Bookings_ToBeScheduled()
{
Map = inspections =>
from i in inspections
from b in i.Bookings.Values
where b.Status == BookingStatus.Requested || b.Status == BookingStatus.InspectorAssigned
select new
{
InspectionId = i.Id,
i.InspectionType,
b.BookingNumber
};
}
}
謝謝Ayende,我找到了解決方案。問題是從Dictionary中選擇'.Values',所以這對我有用 - 從i.Bookings中的b,然後使用b.Value.BookingNumber – CRG