How to pass ObjectId from MongoDB in MVC.net
问题 I'm starting a new project with Mongo, NoRM and MVC .Net. Before I was using FluentNHibernate so my IDs were integer, now my IDs are ObjectId. So when I have an Edit link my URL looks like this : WebSite/Admin/Edit/23,111,160,3,240,200,191,56,25,0,0,0 And it does not bind automaticly to my controller as an ObjectId Do you have any suggestions/best practices to work with this? Do I need to encode/decode the ID everytime? Thanks! 回答1: I Use following public class ObjectIdModelBinder :