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); }
public MongoRepository(string connection) { _context = MongodbContext.Create(connection); }