public string CreateOrderItem(OrderItem orderItem) { CheckHelper.ArgumentNotNull(orderItem, "orderItem"); CheckHelper.WithinCondition(SecurityService.IsLoggedIn, "SecurityService.IsLoggedIn"); var errors = IoC.Container.Get <IValidateService>().Validate(orderItem); if (errors != null) { return(errors.ToErrorMessage()); } var createdOrderItem = (OrderItem)orderItem.Clone(); var errorMessage = APIClientHelper <DocumentAPIClient> .Call(c => c.CreateOrderItem(ref createdOrderItem)); orderItem.Id = createdOrderItem.Id; return(errorMessage); }