C#实现的MongoDB驱动:Simple-mongodb
                 jopen
                 13年前
            
                    Simple-mongodb 是一个C#实现的MongoDB驱动。重点就在于使用匿名类型和JSON来保持它的“动态”。
  
- 不需要继承一个特定的基类
- 不需要映射
- 无需使用键 - 值字典
插入示例:
var sessionFactory = new SimoSessionFactory();  using (var session = sessionFactory.GetSession("Pls.Simo.GettingStarted"))  {      var db = session["MyDatabase"];      var collection = db.GetCollection<InterestingUrl>();        var interestingUrl = new InterestingUrl(@"http://code.google.com/p/simple-mongodb") { Description = "The home of the Simple-MongoDB driver." };      interestingUrl.SetTags("Simple-MongoDB", "Project site");      collection.Insert(interestingUrl);  }查询示例:var sessionFactory = new SimoSessionFactory();  using (var session = sessionFactory.GetSession("Pls.Simo.GettingStarted"))  {      var entityStore = new SimoEntityStore(session, "MyDatabase");        var interestingUrl = entityStore.FindOne<InterestingUrl>(new { Url = @"http://daniel.wertheim.se" });  }</strong>