NoRM
NoRM copied to clipboard
Column aliases
Given a class to be persisted using Norm that in its static constructor declares the column aliases as shown in your examples in http://wiki.github.com/atheken/NoRM/configuration, when I save the class everything goes ok, fields are persisted to the database using the aliases. Unfortunately, when I load the class from the database, an exception throws because there is no property in the class named as the alias. E.g., if I have a column named "foo" and I set its alias to "bar", when I save the object, the column is named "bar" in the database. But when I load the object from the database (i.e., using Find()), an exception says that there is no property named "bar" in the object.
This is because aliasing is not supported in the "Raw" MongoCollection find methods. I want to make this supported, but doing it in a way that doesn't break clients is non-trivial. Look for this in a post-1.0 release.