public ActionResult huntGames() { var mongoClient = new MongoClient("Server=localhost:27017"); var mongoServer = mongoClient.GetServer(); var db = mongoServer.GetDatabase("hntsprt"); MongoCollection <BsonDocument> products = db.GetCollection <BsonDocument>("gamedets"); hntgModal hm = new hntgModal(); hm.games = products; return(View(hm)); }
public ActionResult manageGame() { var mongoClient = new MongoClient("Server=localhost:27017"); var mongoServer = mongoClient.GetServer(); var db = mongoServer.GetDatabase("hntsprt"); MongoCollection <BsonDocument> games = db.GetCollection <BsonDocument>("gamedets"); MongoCollection <BsonDocument> teams = db.GetCollection <BsonDocument>("regdets"); hntgModal hm = new hntgModal(); hm.games = games; hm.teams = teams; return(View(hm)); }