Example #1
0
 /// <summary>
 /// Creates a draft from an existing template.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='createFromTemplateModel'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <object> CreateFromTemplateAsync(this IEnvelope operations, DraftCreateFromTemplateModel createFromTemplateModel, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateFromTemplateWithHttpMessagesAsync(createFromTemplateModel, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Example #2
0
 /// <summary>
 /// Creates a draft from an existing template.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='createFromTemplateModel'>
 /// </param>
 public static object CreateFromTemplate(this IEnvelope operations, DraftCreateFromTemplateModel createFromTemplateModel)
 {
     return(Task.Factory.StartNew(s => ((IEnvelope)s).CreateFromTemplateAsync(createFromTemplateModel), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }