The issue encountered revolves around the creation of a SharePoint list using Microsoft Graph SDK Create a SharePoint List - Microsoft Graph v1.0 | Microsoft Learn, where the property for defining the list template is incorrectly documented. The Microsoft Graph SDK documentation suggests using List, but the correct property name is ListProp. This leads to a compilation error when attempting to define the list template during the list creation process.
Correction Details
Current Documentation Issue: The current Microsoft Graph SDK documentation uses the property List to define the list template when creating a new list. However, this property does not exist in the SDK, causing compilation errors.
Correct Property Name: The correct property to use is ListProp (capital "L" and "P") to define the list template (e.g., "genericList").
Incorrect Documentation Example:
var requestBody = new List
{
DisplayName = "Books",
Columns = new List<ColumnDefinition>
{
new ColumnDefinition
{
Name = "Author",
Text = new TextColumn { }
},
new ColumnDefinition
{
Name = "PageCount",
Number = new NumberColumn { }
}
},
List = new ListInfo
{
Template = "genericList"
}
};
Corrected Example:
var requestBody = new Microsoft.Graph.Models.List
{
DisplayName = "Books",
Columns = new List<ColumnDefinition>
{
new ColumnDefinition
{
Name = "Author",
Text = new TextColumn { }
},
new ColumnDefinition
{
Name = "PageCount",
Number = new NumberColumn { }
}
},
// Correct property name for list template
ListProp = new ListInfo
{
Template = "genericList"
}
};
The existing documentation implies that the property List should be used for specifying list templates, which does not match the SDK's actual implementation. This discrepancy causes confusion for developers and leads to runtime errors. he SDK correctly uses ListProp to define the list template, but this detail is currently missing or incorrect in the documentation.
Conclusion
The issue with the Microsoft Graph SDK documentation stems from an inconsistency between the documented property List and the actual ListProp used in the SDK for defining list templates. To resolve this:
Correct the documentation to reflect the proper use of ListProp instead of List.
Developers should update their code to use ListProp when defining list templates.
Overview
The issue encountered revolves around the creation of a SharePoint list using Microsoft Graph SDK Create a SharePoint List - Microsoft Graph v1.0 | Microsoft Learn, where the property for defining the list template is incorrectly documented. The Microsoft Graph SDK documentation suggests using
List
, but the correct property name isListProp
. This leads to a compilation error when attempting to define the list template during the list creation process.Correction Details
List
to define the list template when creating a new list. However, this property does not exist in the SDK, causing compilation errors.ListProp
(capital "L" and "P") to define the list template (e.g.,"genericList"
).Incorrect Documentation Example:
Corrected Example:
For Steps to create new list refer -
c# - Azure function app GraphServiceClient create list - Stack Overflow
Documentation Correction Justification
The existing documentation implies that the property
List
should be used for specifying list templates, which does not match the SDK's actual implementation. This discrepancy causes confusion for developers and leads to runtime errors. he SDK correctly usesListProp
to define the list template, but this detail is currently missing or incorrect in the documentation.Conclusion
The issue with the Microsoft Graph SDK documentation stems from an inconsistency between the documented property
List
and the actualListProp
used in the SDK for defining list templates. To resolve this:ListProp
instead ofList
.ListProp
when defining list templates.