Example #1
0
        public ActionResult <Knight> Edit(int id, [FromBody] Knight updated)
        {
            updated.Id = id;
            Knight data = _service.Edit(updated);

            return(Ok(data));
        }
 public ActionResult<Knight> EditKnight([FromBody] Knight updated, int id)
 {
     try
      {
     updated.Id = id;
     return Ok(_service.Edit(updated));
      }
      catch (Exception e)
      {
     return BadRequest(e.Message);
      }
 }
 public ActionResult <Knight> Edit(int id, [FromBody] Knight knight)
 {
     try
     {
         knight.Id = id;
         return(Ok(_service.Edit(id, knight)));
     }
     catch (SystemException err)
     {
         return(BadRequest(err.Message));
     }
 }
Example #4
0
 public ActionResult <Knight> Edit([FromBody] Knight update, int id)
 {
     try
     {
         update.Id = id;
         return(Ok(_ks.Edit(update)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }