示例#1
0
        /// <summary>
        /// Submits a subscription conversion.
        /// </summary>
        /// <param name="conversion">The new subscription conversion information.</param>
        /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
        /// <returns>The subscription conversion results.</returns>
        public async Task <ConversionResult> CreateAsync(Conversion newEntity, CancellationToken cancellationToken = default)
        {
            newEntity.AssertNotNull(nameof(newEntity));

            return(await Partner.ServiceClient.PostAsync <Conversion, ConversionResult>(
                       new Uri(
                           string.Format(
                               CultureInfo.InvariantCulture,
                               $"/{PartnerService.Instance.ApiVersion}/{PartnerService.Instance.Configuration.Apis.PostSubscriptionConversion.Path}",
                               Context.Item1,
                               Context.Item2),
                           UriKind.Relative),
                       newEntity,
                       cancellationToken).ConfigureAwait(false));
        }