For anyone interested: I have added support for circular object references
inside a single document. Now you can store a complete tree with parent
references (making it circular) in one document:
Tree top = new Tree() { Title = "Top" };
Tree child = new Tree() { Title = "Child", Parent = top };
top.Children.Add(child);
It only works for CLR objects, not arrays nor expando objects or
dictionaries.
I have also added a "ignore" configuration, such that your POCO domain
objects do not have to know anything of NoRM:
MongoConfiguration.Initialize(r => r.For<User>(u => u.ForProperty(user
=> user.FirstName).Ignore()));
At last there is also support for BSON "type convertes". Such converters can
be registered at startup and are used to convert otherwise non-serializable
CLR values into serializable BSON friendly values. For instance a
CultureInfo converter that converts a CultureInfo into a string like "en-US"
and back again:
public class CultureInfoTypeConverter : IBsonTypeConverter
{
#region IBsonTypeConverter Members
public Type SerializedType
{
get { return typeof(string); }
}
public object ConvertToBson(object data)
{
return ((CultureInfo)data).Name;
}
public object ConvertFromBson(object data)
{
return new CultureInfo((string)data);
}
#endregion
}
All of this can be found here:
http://github.com/JornWildt/NoRM
Kind regards, Jørn Wildt
--
You received this message because you are subscribed to the Google Groups "NoRM mongodb" group.
To post to this group, send email to
norm-m...@googlegroups.com.
To unsubscribe from this group, send email to
norm-mongodb...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/norm-mongodb?hl=en.