public class TestEntity
{
public string Id { get; set; }
private string _description;
public TestEntity(string description)
{
_description = description;
}
}
public class Custom : DefaultRavenContractResolver
{
protected override List<MemberInfo> GetSerializableMembers(Type type)
{
var members = new List<MemberInfo>();
members.AddRange(type.GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance));
members.AddRange(type.GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance));
return members;
}
public Custom(bool shareCache) : base(shareCache)
{
}
}
public class TestModel
{
public string Description { get; set; }
}
public void Test()
{
var id = "fs";
using (var session = Store.OpenSession())
{
var t = new TestEntity("Lol");
session.Store(t);
session.SaveChanges();
id = t.Id;
}
using (var session = Store.OpenSession())
{
var t = session.Load<TestModel>(id);
}
}
Hibernating Rhinos Ltd
Oren Eini l CEO l Mobile: + 972-52-548-6969
Office: +972-4-622-7811 l Fax: +972-153-4-622-7811
--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+unsubscribe@googlegroups.com.