Пример #1
0
 public static MongodbContext Create(string connection)
 {
     if (context == null)
     {
         context = new MongodbContext();
         var url = MongoUrl.Create(connection);
         context.client   = new MongoClient(url);
         context.database = context.client.GetDatabase(url.DatabaseName);
     }
     return(context);
 }
Пример #2
0
 public MongoRepository(string connection)
 {
     _context = MongodbContext.Create(connection);
 }