예제 #1
0
        // 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));
        }
예제 #2
0
        static void Main()
        {
            string baseAddress = "http://*:5000/";

            // Start OWIN host
            using (WebApp.Start <Startup>(url: baseAddress))
            {
                var rinkCollection = RinkCollection.GetCollection();
                Console.ReadLine();
            }
        }
예제 #3
0
 static RinkManager()
 {
     Rinks          = RinkCollection.GetCollection();
     CurrentPlayers = new Dictionary <string, List <User> >();
     Rinks.ForEach(rink => CurrentPlayers.Add(rink.Id, new List <User>()));
 }
예제 #4
0
        // GET api/info
        // Gets all rinks
        public string Get()
        {
            var rinkCollection = RinkCollection.GetCollection();

            return(JsonConvert.SerializeObject(rinkCollection));
        }