microsoft/teams.net

Public

mirrored fromhttps://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
1e6c6424b397bc7a2e03de41e3d58c1434d9ba5e

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.Cards/Actions/TaskFetchAction.cs

38lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4using Microsoft.Teams.Common;
5
6namespace Microsoft.Teams.Cards;
7
8public class TaskFetchAction : SubmitAction
9{
10 public TaskFetchAction(IDictionary<string, object?>? value = null)
11 {
12 var submitActionData = new SubmitActionData
13 {
14 Msteams = new TaskFetchSubmitActionData()
15 };
16
17 if (value != null)
18 {
19 foreach (var kvp in value)
20 {
21 submitActionData.NonSchemaProperties[kvp.Key] = kvp.Value;
22 }
23 }
24
25 Data = new Union<string, SubmitActionData>(submitActionData);
26 }
27
28 public static IDictionary<string, object?> FromObject(object obj)
29 {
30 if (obj == null) throw new ArgumentNullException(nameof(obj));
31
32 return obj.GetType()
33 .GetProperties()
34 .ToDictionary(
35 p => p.Name,
36 p => (object?)p.GetValue(obj));
37 }
38}