Exemple #1
0
        // PUT: api/Houses/{id}
        public IHttpActionResult Put(int id, [FromBody] HouseDTO value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Not a valid model"));
            }

            ThronesTournamentManager m = new ThronesTournamentManager();

            m.UpdateHouse(value.Transform());

            return(Ok());
        }
Exemple #2
0
        // POST: api/Houses
        public IHttpActionResult Post([FromBody] HouseDTO value)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid data"));
            }

            ThronesTournamentManager m = new ThronesTournamentManager();

            m.AddHouse(value.Transform());

            return(Ok());
        }