Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update listitems-intro.md #1425

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/using-the-sdk/listitems-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ var myList = context.Web.Lists.GetByTitle("My List", p => p.Title,
// Do a paged retrieval (non async sample) of the list items with additional collection loads
foreach(var listItem in myList.Items.QueryProperties(p => p.All,
p => p.RoleAssignments.QueryProperties(p => p.PrincipalId,
p => p.RoleDefinitions))
p => p.RoleDefinitions))
{
// Do something with the list item
if (listItem["MyStatus"].ToString() == "Pending")
Expand Down Expand Up @@ -158,8 +158,8 @@ string viewXml = @"<View>
<Value Type='text'><![CDATA[Item1]]</Value>
</BeginsWith>
</Where>
<OrderBy Override='TRUE'><FieldRef Name='ID' Ascending='FALSE' /></OrderBy>
</Query>
<OrderBy Override='TRUE'><FieldRef Name= 'ID' Ascending= 'FALSE' /></OrderBy>
</View>";

// Execute the query
Expand Down Expand Up @@ -215,10 +215,10 @@ string viewXml = @$"<View>
<Value Type='Integer'>0</Value>
</Eq>
</Where>
<OrderBy Override='TRUE'><FieldRef Name='ID' Ascending='FALSE' /></OrderBy>
</Query>
<OrderBy Override='TRUE'><FieldRef Name= 'ID' Ascending= 'FALSE' /></OrderBy>
<RowLimit>{pageSize}</RowLimit>
</View>";
</View>";

// Load all the needed data using paged requests
bool paging = true;
Expand Down Expand Up @@ -337,8 +337,8 @@ string viewXml = @"<View>
<Value Type='text'>![CDATA[Item1]]</Value>
</BeginsWith>
</Where>
<OrderBy Override='TRUE'><FieldRef Name='ID' Ascending='FALSE' /></OrderBy>
</Query>
<OrderBy Override='TRUE'><FieldRef Name= 'ID' Ascending= 'FALSE' /></OrderBy>
<RowLimit>5</RowLimit>
</View>";

Expand Down Expand Up @@ -391,8 +391,8 @@ string viewXml = @"<View>
<Value Type='text'>![CDATA[Item1]]</Value>
</BeginsWith>
</Where>
<OrderBy Override='TRUE'><FieldRef Name='ID' Ascending='FALSE' /></OrderBy>
</Query>
<OrderBy Override='TRUE'><FieldRef Name= 'ID' Ascending= 'FALSE' /></OrderBy>
<RowLimit Paged='TRUE'>20</RowLimit>
</View>";

Expand Down Expand Up @@ -607,7 +607,7 @@ await context.ExecuteAsync();

To add a folder to a list the list first must be configured to allow content types (`ContentTypesEnabled`) and allow folders (`EnableFolderCreation`). Once that's done use one of the `AddListFolder` methods to add a folder.

``` csharp
```csharp
list.ContentTypesEnabled = true;
list.EnableFolderCreation = true;
await list.UpdateAsync();
Expand Down
Loading