// GET api/info/5 public string Get([FromUri] string id) { var rinkCollection = RinkCollection.GetCollection(); var rink = rinkCollection.Find(r => r.Id == id); return(JsonConvert.SerializeObject(rink)); }
static void Main() { string baseAddress = "http://*:5000/"; // Start OWIN host using (WebApp.Start <Startup>(url: baseAddress)) { var rinkCollection = RinkCollection.GetCollection(); Console.ReadLine(); } }
static RinkManager() { Rinks = RinkCollection.GetCollection(); CurrentPlayers = new Dictionary <string, List <User> >(); Rinks.ForEach(rink => CurrentPlayers.Add(rink.Id, new List <User>())); }
// GET api/info // Gets all rinks public string Get() { var rinkCollection = RinkCollection.GetCollection(); return(JsonConvert.SerializeObject(rinkCollection)); }