public async Task <IActionResult> Post(Port value) { try { var result = context.Post(value); string username = User.Identity.Name; return(Ok(await result)); } catch (Exception ex) { return(BadRequest(new ErrorMessage(ex.Message))); } }
public IHttpActionResult Post(port value) { try { var result = context.Post(value); string username = User.Identity.Name; context.BroadcastData(result); return(Ok(result)); } catch (Exception ex) { return(Content(HttpStatusCode.NotAcceptable, ex.Message)); } }