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