I have posted the bug to the
json.net forum.
Just to know that the bug in the Json.net library doesn't allow to
RavnDB (build 888) to store the following class:
static void Main( string[] args )
{
var documentStore = new EmbeddableDocumentStore()
{
DataDirectory =
Path.Combine(Path.GetTempPath(), "foo"),
UseEmbeddedHttpServer =
true
};
documentStore.Initialize();
var person1 = new Dumb {Name = "John"};
var person2 = new Dumb { Name = "John" };
person1.Children.Add(person1);
using ( var session = documentStore.OpenSession() )
{
session.Store( person1 );
session.SaveChanges();
}
}
[JsonObject( IsReference = true )]
public class Dumb
{
public Guid Id { get; set; }
public String Name { get; set; }
public List<Dumb> Children { get; private set; }
public Dumb()
{
Name = String.Empty;
Children = new List<Dumb>();
}
public override bool Equals( object obj )
{
return true;
}
}
On May 22, 3:13 pm, "Oren Eini (Ayende Rahien)" <
aye...@ayende.com>
wrote: