DefaultValue = new DefaultColumnValue {值=“某些文本”}不起作用

问题描述 投票:0回答:1

[。NET core 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#示例?

c# .net-core azure-functions azure-ad-graph-api office365api
1个回答
0
投票

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

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

© www.soinside.com 2019 - 2024. All rights reserved.