Esempio n. 1
0
 /// <summary> Adds a participant to a thread asynchronously. If the participant already exist, no change occurs. </summary>
 /// <param name="participant"> Participant to add to a chat thread. </param>
 /// <param name="cancellationToken"> The cancellation token to use. </param>
 /// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception>
 public virtual async Task <Response <AddChatParticipantsResult> > AddParticipantAsync(ChatParticipant participant, CancellationToken cancellationToken = default)
 {
     using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ChatThreadClient)}.{nameof(AddParticipant)}");
     scope.Start();
     try
     {
         return(await _chatThreadRestClient.AddChatParticipantsAsync(Id, new[] { participant.ToChatParticipantInternal() }, cancellationToken).ConfigureAwait(false));
     }
     catch (Exception ex)
     {
         scope.Failed(ex);
         throw;
     }
 }