public IHttpActionResult CreateOrder(webModel.CustomerOrder customerOrder)
 {
     var retVal = _customerOrderService.Create(customerOrder.ToCoreModel());
     return Ok(retVal.ToWebModel());
 }
 public IHttpActionResult Update(webModel.CustomerOrder order)
 {
     var coreOrder = order.ToCoreModel();
     _customerOrderService.Update(new coreModel.CustomerOrder[] { coreOrder });
     return StatusCode(HttpStatusCode.NoContent);
 }
		public IHttpActionResult Update(webModel.CustomerOrder customerOrder)
        {
			var coreOrder = customerOrder.ToCoreModel();

            //Check scope bound permission
            var scopes = _permissionScopeService.GetObjectPermissionScopeStrings(coreOrder).ToArray();
            if (!_securityService.UserHasAnyPermission(User.Identity.Name, scopes, OrderPredefinedPermissions.Read))
            {
                throw new HttpResponseException(HttpStatusCode.Unauthorized);
            }

            _customerOrderService.Update(new coreModel.CustomerOrder[] { coreOrder });
            return StatusCode(HttpStatusCode.NoContent);
        }