// POST: api/CitiesAgentCanAccess public IHttpActionResult Post([FromBody] CityAgentCanAccess value) { try { return(Ok(context.Post(value))); } catch (Exception ex) { return(Content(HttpStatusCode.NotAcceptable, ex.Message)); } }
public async Task <IActionResult> Post([FromBody] Cityagentcanaccess value) { try { return(Ok(await context.Post(value))); } catch (Exception ex) { return(BadRequest(new ErrorMessage(ex.Message))); } }