Skip to content

Commit

Permalink
Merge branch 'patch-1' of https://github.com/cesarhoeflich/pnpcore in…
Browse files Browse the repository at this point in the history
…to pr461
  • Loading branch information
jansenbe committed May 21, 2021
2 parents e39e0b7 + 349f2e5 commit e960bc7
Showing 1 changed file with 6 additions and 4 deletions.
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

0 comments on commit e960bc7

Please sign in to comment.