2012-05-13 18 views
2

对我来说,json是小写字母。RavenDB和小写json序列化 - 执行查询时的问题

所以我定义的简单类型是这样的:

public class Profile: RootAggregate 
{ 
    [JsonProperty("name")] 
    public string Name { get; set; } 
} 

使用ravendb,我能坚持它:

documentSession.Store(new Profile { Name = "myprofile" }); 

,然后检索:

var profile = session.Query<Profile>() 
        .Customize(x => x.WaitForNonStaleResultsAsOfNow()) 
        .Where(x => x.Name == "myprofile") 
        .SingleOrDefault(); 

它返回... NULL。

如果属性[JsonProperty("name")]不会在那里,这会导致:

查询工作正常。

如何保留属性并强制查询按预期工作?

顺便说一句:我使用RavenDB - 建立#888

+0

http://issues.hibernatingrhinos.com/issue/RavenDB-283?projectKey=RavenDB(固定在建949) – jwaliszko

回答