示例#1
0
 /// <summary>
 /// Creates a new Trend and returns it.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='newItem'>
 /// Definition of how the Trend will be created.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <TrendModel> CreateAsync(this ITrends operations, NewTrendModel newItem, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateWithHttpMessagesAsync(newItem, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
示例#2
0
 /// <summary>
 /// Creates a new Trend and returns it.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='newItem'>
 /// Definition of how the Trend will be created.
 /// </param>
 public static TrendModel Create(this ITrends operations, NewTrendModel newItem)
 {
     return(Task.Factory.StartNew(s => ((ITrends)s).CreateAsync(newItem), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }