예제 #1
0
        // DELETE api/rinks/5
        public void Delete([FromUri] string id, [FromBody] string userData)
        {
            User user = JsonConvert.DeserializeObject <User>(userData);

            Console.WriteLine("RemoveUser: "******"LeaveRink: " + id);
            RinkManager.LeaveRink(user, id);
        }
예제 #2
0
        // POST api/rinks/5
        public void Post([FromUri] string id, [FromBody] string userData)
        {
            User user;

            if (userData != null)
            {
                user = JsonConvert.DeserializeObject <User>(userData);
            }
            else
            {
                user = new User("Samuel Chapleau", "Gardien", "Parc Beaubien");
            }
            Console.WriteLine("AddUser: "******"JoinRink: " + id);
            RinkManager.JoinRink(user, id);
        }