コード例 #1
0
        public IHttpActionResult Put(Accessory accessory)
        {
            var accessoryToUpdate = _accessoryService.GetById(accessory.Id);

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

            accessoryToUpdate.Status = accessory.Status;

            _accessoryService.Update(accessoryToUpdate);

            return Ok(accessoryToUpdate);
        }
コード例 #2
0
 public IHttpActionResult Post(Accessory accessory)
 {
     return Ok(_accessoryService.Add(accessory));
 }