Now that RavenDB 1.2 has Json.NET embedded, it'd be nice if either:
- JsonIgnoreAttribute is renamed to RavenIgnoreAttribute
- or
JsonIgnoreAttribute is no longer made sealed, so we can inherit from it ourselves
I have a web application which has classes, that I a) store in Raven, and b) serialize to JSON (using Json.Net) and return in response to HTTP requests that my web application receives.
My class has some properties that I'd like Raven to ignore, and other properties which I'd like Json.NET to ignore. An example:
public class Document
{
// Property to be ignored by Raven
[Raven.Imports.Newtonsoft.Json.JsonIgnore]
public string Property1 { get; set; }
//Property to be ignored by Json.NET
[Newtonsoft.Json.JsonIgnore]
public string Property2 { get; set; }
}
Ideally, this is how I'd like the attributes to be named:
public class Document
{
// Property to be ignored by Raven
[RavenIgnore]
public string Property1 { get; set; }
//Property to be ignored by Json.NET
[JsonIgnore]
public string Property2 { get; set; }
}