// POST api/Locations public IHttpActionResult Post([FromBody] Location value) { try { db.Add(value); } catch (Exception ex) { ModelState.AddModelError(nameof(Country), ex.Message); return(BadRequest(ModelState)); } return(Ok()); }