public IActionResult PutEvent([FromBody] EventTransferObject eventTransferObject) { var @event = _mapper.Map <Event>(eventTransferObject); try { _eventService.UpdateEvent(@event); return(Ok()); } catch (AppException ex) { return(BadRequest(new { message = ex.Message })); } }
public IActionResult PostEvent([FromBody] EventTransferObject eventTransferObject) { var @event = _mapper.Map <Event>(eventTransferObject); try { // save _eventService.Create(@event); return(Ok()); } catch (AppException ex) { // return error message if there was an exception return(BadRequest(new { message = ex.Message })); } }