コード例 #1
0
        public IHttpActionResult Put(House house)
        {
            var houseToUpdate = _houseService.GetById(house.Id);

            if (houseToUpdate == null)
            {
                return NotFound();
            }

            houseToUpdate.Name = house.Name;
            houseToUpdate.ApiKey = house.ApiKey;

            _houseService.Update(houseToUpdate);

            return Ok(houseToUpdate);
        }
コード例 #2
0
 public IHttpActionResult Post(House house)
 {
     return Ok(_houseService.Add(house));
 }