我有一個索引:只有RavenDB地圖索引AsProjection後返回空值<T>
public class TestIndex : AbstractIndexCreationTask<Resource>
{
public class Result
{
public string Caption { get; set; }
public string TestVal{ get; set; }
}
public TestIndex()
{
Map = resources => from r in resources
select new
{
Caption = r.Caption,
TestVal = r.Caption
};
}
}
這就是我如何查詢它:
var data = session.Query<Resource, TestIndex>()
.Customize(x => x.WaitForNonStaleResults())
.AsProjection<TestIndex.Result>()
.ToList();
的問題是,經過查詢名爲testVal的屬性爲null對於每個對象,標題填充期望值時。