/// <summary> /// Executes the operations associated with the cmdlet. /// </summary> public override void ExecuteCmdlet() { Scheduler.RunTask(async() => { if (ShouldProcess(string.Format(CultureInfo.CurrentCulture, Resources.CheckoutPartnerCustomerCartWhatIf, CartId))) { IPartner partner = await PartnerSession.Instance.ClientFactory.CreatePartnerOperationsAsync(CorrelationId, CancellationToken).ConfigureAwait(false); CartCheckoutResult checkoutResult = await partner.Customers[CustomerId].Carts[CartId].CheckoutAsync(CancellationToken).ConfigureAwait(false); WriteObject(new PSCartCheckoutResult(checkoutResult)); } }, true); }
/// <summary> /// Initializes a new instance of the <see cref="PSCartLineItem" /> class. /// </summary> /// <param name="checkoutResult">An instance of the <see cref="CartCheckoutResult" /> class that will serve as a base for this instance.</param> public PSCartCheckoutResult(CartCheckoutResult checkoutResult) { this.CopyFrom(checkoutResult); }