DefaultValue =新的DefaultColumnValue {Value =“ Some text”}不起作用

时间:2019-10-20 13:07:33

标签: c# .net-core azure-functions azure-ad-graph-api office365api

在.NET核心C#中,没有与Microsoft.Graph一起使用的示例,API都是JSON。 我能够创建选择站点列,但默认值不起作用

 Microsoft.Graph.ColumnDefinition column = new Microsoft.Graph.ColumnDefinition
                {
                    ColumnGroup = "ECGmc",
                    DisplayName = "Document Stage",
                    Name = "DocumentStage",
                    Choice = new ChoiceColumn { ODataType= "microsoft.graph.choiceColumn", AllowTextEntry = false,
                        Choices = new List<string>() { "Working Draft", "Discussion Draft", "Final" }, DisplayAs = "dropDownMenu" },
                    DefaultValue = new DefaultColumnValue { Value = "Working Draft", ODataType= "microsoft.graph.defaultColumnValue" },
                    Description = "Will differ the stages the Document changes",
                    Required = true
                };
                Microsoft.Graph.ColumnDefinition newColumn = await graphClient.Groups[project.GroupID].Sites["root"].Columns.Request().AddAsync(column);

有效,但是DefaultValue为空。

有人知道如何设置DefaultValue吗? 有谁知道我在哪里可以找到Microsoft.Graph的C#示例?

1 个答案:

答案 0 :(得分:0)

我在本地环境中对其进行了测试,但是我成功获取了“ DefaultValue”。我没有添加“ ODataType”。在下面,我发布了我的代码和“ Console.WriteLine”结果的屏幕截图: enter image description here

此处“ DefaultValue”不为空。希望对您有帮助。