public async Task <IActionResult> PutNotificationAdress(Guid id, [FromBody] NotificationAdressUpdateDto updateDto) { this.logger.LogTrace("Call PutNotificationAdress with id={0} NotificationAdress='{1}'.", id, updateDto?.NotificationAdress); bool hasUpdated = await this.notificationSender.SetNotificationAdress(id, updateDto.NotificationAdress).ConfigureAwait(false); if (hasUpdated) { this.logger.LogInformation("Update NotificationAdress with id={0} NotificationAdress='{1}'.", id, updateDto?.NotificationAdress); updateDto.QueuId = id; return(this.Ok(updateDto)); } else { return(this.NotFound()); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// </param> /// <param name='body'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <object> PutNotificationAdressAsync(this IPassiveMQAPI operations, Guid id, NotificationAdressUpdateDto body = default(NotificationAdressUpdateDto), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PutNotificationAdressWithHttpMessagesAsync(id, body, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='id'> /// </param> /// <param name='body'> /// </param> public static object PutNotificationAdress(this IPassiveMQAPI operations, Guid id, NotificationAdressUpdateDto body = default(NotificationAdressUpdateDto)) { return(Task.Factory.StartNew(s => ((IPassiveMQAPI)s).PutNotificationAdressAsync(id, body), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }