How to store poco c# objects using MongoDB .net driver? The custom attributes and ObjectId methods are intrusive and require changes to the domain classes introducing coupling with mongodb. Are there well documented methods to use POCO classes with MongoDB? Also any integration with SpringFramework.net.
1 Answer
The documentation (http://mongodb.github.io/mongo-csharp-driver/2.0/reference/bson/mapping/) has many examples. Anything you can do with attributes can be done via code as well.
Regarding the ObjectId, I'd suggest using a string and indicating(via code) that it should be stored as an ObjectId in the database. Alternatively, just use a Guid.