示例#1
0
        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());
            }
        }
示例#2
0
 /// <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);
     }
 }
示例#3
0
 /// <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());
 }