public async Task <ActionResult> Post(Permit entity) { try { await _service.Create(entity); await _service.SaveChanges(); } catch (Exception) { return(BadRequest(new { entity = entity, message = "There was a problem adding the Permit" })); } return(Created("/permit", entity)); }