public int UpdateOrder(Order_x order) { string UID = CheckJWT(WebOperationContext.Current); var user = repository.GetUserByUID(UID); if ((user == null & user.Id != order.Pet.UserId) && (order.Sitter == null & order.Sitter.UID != UID)) { throw new Exception("UidProvideUserDontMachWithAuthUid"); } return(repository.UpdateOrder(order)); }