开发者

Properly Abstract OId in MongoDB with MongoDB-CSharp

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开发者_JS百科 on this?

Thanks, Dan


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜