public ActionResult <Knight> Create([FromBody] Knight newKnight) { try { return(Ok(_service.Create(newKnight))); } catch (System.Exception err) { return(BadRequest(err.Message)); } }
public ActionResult<Knight> Create([FromBody] Knight newKnight) { try { return Ok(_service.Create(newKnight)); } catch (Exception e) { return BadRequest(e.Message); } }
public ActionResult <Knight> Create([FromBody] Knight knightData) { try { return(Ok(_ks.Create(knightData))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult <Knight> Create([FromBody] Knight newKnight) { try { Knight knight = _knightsService.Create(newKnight); return(Ok(knight)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult <Knight> Create([FromBody] Knight newKnight) // This says that "From the Body" create a Knight called "newKnight" { try { Knight knight = _service.Create(newKnight); return(Ok(knight)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult <Knight> Create([FromBody] Knight knight) { return(Ok(_service.Create(knight))); }