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 #461

Merged
merged 1 commit into from
May 21, 2021
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
10 changes: 6 additions & 4 deletions docs/using-the-sdk/listitems-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ SharePoint [CAML](https://docs.microsoft.com/en-us/sharepoint/dev/schema/query-s

```csharp
// Assume the fields where not yet loaded, so loading them with the list
var myList = context.Web.Lists.GetByTitle("My List", p => p.Title, p => p.Items,
// If you are using CAML query, do not use the parameter 'p => p.Items'. It causes full items to load, ignoring the CAML query.
var myList = context.Web.Lists.GetByTitle("My List", p => p.Title,
p => p.Fields.QueryProperties(p => p.InternalName, p => p.FieldTypeKind, p => p.TypeAsString, p => p.Title));

// Build a query that only returns the Title field for items where the Title field starts with "Item1"
Expand Down Expand Up @@ -80,7 +81,8 @@ By setting a row limit in the CAML query combined with using the the PagingInfo

```csharp
// Assume the fields where not yet loaded, so loading them with the list
var myList = context.Web.Lists.GetByTitle("My List", p => p.Title, p => p.Items,
// If you are using CAML query, do not use the parameter 'p => p.Items'. It causes full items to load, ignoring the CAML query.
var myList = context.Web.Lists.GetByTitle("My List", p => p.Title,
p => p.Fields.QueryProperties(p => p.InternalName, p => p.FieldTypeKind, p => p.TypeAsString, p => p.Title));

// Build a query that only returns the first 20 rows where the Title field starts with "Item1"
Expand Down Expand Up @@ -132,7 +134,7 @@ Using the [LoadListDataAsStreamAsync method](https://pnp.github.io/pnpcore/api/P

```csharp
// Assume the fields where not yet loaded, so loading them with the list
var myList = context.Web.Lists.GetByTitle("My List", p => p.Title, p => p.Items,
var myList = context.Web.Lists.GetByTitle("My List", p => p.Title,
p => p.Fields.QueryProperties(p => p.InternalName, p => p.FieldTypeKind, p => p.TypeAsString, p => p.Title));

// Build a query that only returns the Title field for the top 5 items where the Title field starts with "Item1"
Expand Down Expand Up @@ -172,7 +174,7 @@ foreach (var listItem in myList.Items.AsRequested())

```csharp
// Assume the fields where not yet loaded, so loading them with the list
var myList = context.Web.Lists.GetByTitle("My List", p => p.Title, p => p.Items,
var myList = context.Web.Lists.GetByTitle("My List", p => p.Title,
p => p.Fields.QueryProperties(p => p.InternalName, p => p.FieldTypeKind, p => p.TypeAsString, p => p.Title));

// Build a query that only returns the Title field for the first 20 items where the Title field starts with "Item1"
Expand Down