public IHttpActionResult AcceptOrder(int id) { try { var identity = (ClaimsIdentity)User.Identity; var name = identity.Claims.Where(x => x.Type == ClaimTypes.Name).Single().Value; return(Ok(_business.AcceptOrder(id, name))); } catch { return(BadRequest()); } }