/// <inheritdoc/> public override async Task <DialogTurnResult> BeginDialogAsync(DialogContext dc, object options = null, CancellationToken cancellationToken = default(CancellationToken)) { if (options is CancellationToken) { throw new ArgumentException($"{nameof(options)} cannot be a cancellation token"); } if (Disabled != null && Disabled.GetValue(dc.State)) { return(await dc.EndDialogAsync(cancellationToken : cancellationToken).ConfigureAwait(false)); } if (dc.Context.Activity.ChannelId != Channels.Msteams) { throw new InvalidOperationException($"{Kind} works only on the Teams channel."); } string memberId = MemberId.GetValueOrNull(dc.State); if (string.IsNullOrEmpty(memberId)) { throw new InvalidOperationException($"Missing {nameof(MemberId)} in {Kind}."); } string teamId = TeamId.GetValueOrNull(dc.State); var result = await TeamsInfo.GetTeamMemberAsync(dc.Context, memberId, teamId, cancellationToken : cancellationToken).ConfigureAwait(false); if (Property != null) { dc.State.SetValue(Property.GetValue(dc.State), result); } return(await dc.EndDialogAsync(result, cancellationToken : cancellationToken).ConfigureAwait(false)); }