0 comments
Nice example of using Dynamic in manipulation with MongoDB-CSharp document
Instead
Document post = new Document(); post["Published"] = DateTime.UtcNow; DateTime published = ((DateTime)mongo_post["Published"]).ToLocalTime();
With Dynamic
dynamic post = new Document(); post.Published = DateTime.UtcNow; DateTime published = mongo_post.Published.ToLocalTime();
Dynamic document implementation http://www.box.net/shared/knqqd9jn9k
Thanks to Scott Watermasysk http://scottw.com/mongodb-dynamics