Skip to content

Commit

Permalink
merge of #471. Thanks @DaleyKD
Browse files Browse the repository at this point in the history
  • Loading branch information
jansenbe committed Jun 2, 2021
1 parent ca8a77a commit 5b0862e
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
6 changes: 6 additions & 0 deletions docs/using-the-sdk/changes-sharepoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ var changes2 = await context.Web.GetChangesAsync(new ChangeQueryOptions(true, tr
});
```

The `lastChangeToken` in previous example is of type `IChangeToken`, if you've stored the actual change token (e.g."1;2;8c8e101c-1b0d-4253-85e7-c30039bf46e2;637577313637500000;563287977") you can construct an `IChangeToken` for it as follows:

```csharp
var lastChangetoken = new ChangeTokenOptions("1;2;8c8e101c-1b0d-4253-85e7-c30039bf46e2;637577313637500000;563287977");
```

## Processing the returned changes

The returned collection of changes all inherit of the same base model `IChange`, but depending on the changed object you get different model. Changes on a web result in a `IChangeWeb` instance, changes on a list in a `IChangeList` instance and so on. When iterating over the changes you can check for the type and cast it as shown in below example. When a change is returned not all properties of the returned object are always populated, use the `IsPropertyAvailable` method to verify a property is populated before using it (in case the property is not always populated).
Expand Down
1 change: 1 addition & 0 deletions src/sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Changed

- Added ChangeTokenOptions class to allow creation of an IChangeToken #471 [DaleyKD - Kyle Daley]
- Fixed an issue where adding items to the root site collection resulted in a 404 #470 [DaleyKD - Kyle Daley]
- Split batches containing Graph Beta and Graph V1 requests into individual batches [jansenbe - Bert Jansen]
- Prevent unneeded extra requests in a batch when the a previous batch was reused [jansenbe - Bert Jansen]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

1 comment on commit 5b0862e

@DaleyKD
Copy link
Contributor

@DaleyKD DaleyKD commented on 5b0862e Jun 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GREAT job at the docs, @jansenbe !

Please sign in to comment.