views:

102

answers:

1

I'm trying to use MongoDB with my POCOs. Using mongodb-csharp library (http://github.com/samus/mongodb-csharp), I've got everything working, but I have to have my Ids set to OIds which requires me to reference the mongodb-csharp library from within my entities assembly. This doesn't seem right. I've searched online but I can't seem to find anyone who is abstracting out the OId so it could be easily replaced. Does someone have some guidance on this?

Thanks, Dan

+1  A: 

I agree that this isn't right, but if you want to use Oids, then this is what has to happen. I'm one of devs on the mongodb-csharp driver, and I personally never use Oids. I will always use Guids. While it takes more space, I believe it is worth that for transportability between different data stores (I use MSSQL for transactional processing) as well as keeping my dependencies transparent.

Craig Wilson