Skip to content

Commit 8d4f15a

Browse files
author
Johnny @PC
committed
Added Async and new Helper Docs
1 parent c3e8a33 commit 8d4f15a

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

docs/SpotifyWebAPI/gettingstarted.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@ if (profile.HasError())
5959
}
6060
```
6161

62+
##Asynchronous
63+
Every API-Call now has an asynchronous method. Just append `Async` to the Method-Name.
64+
Example:
65+
```cs
66+
public async void Test()
67+
{
68+
var profile = await _spotify.GetPrivateProfileAsync();
69+
Console.WriteLine(profile.DisplayName);
70+
}
71+
```
72+
6273
---
6374

6475
##API-Reference
@@ -120,3 +131,6 @@ if (profile.HasError())
120131
###Tracks
121132
* [GetSeveralTracks](/SpotifyWebAPI/tracks#getseveraltracks)
122133
* [GetTrack](/SpotifyWebAPI/tracks#gettrack)
134+
135+
###Util
136+
* [Utility-Functions](/SpotifyWebAPI/util)

docs/SpotifyWebAPI/util.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
##Paging-Methods
2+
The `SpotifyWebAPI` features two paging-helper Methods, `GetNextPage()` and `GetPreviousPage()`.
3+
Both are an easy way to receive the next/previous page of a Paging-Object.
4+
5+
Sample:
6+
````csharp
7+
var playlistTracks = _spotify.GetPlaylistTracks("1122095781", "4EcNf2l8rXInbJOf3tQdgU", "", 50);
8+
while (true)
9+
{
10+
Console.WriteLine(playlistTracks.Items.Count);
11+
if (!playlistTracks.HasNextPage())
12+
break;
13+
playlistTracks = _spotify.GetNextPage(playlistTracks);
14+
}
15+
````

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pages:
1414
- ['SpotifyWebAPI/profiles.md', 'SpotifyWebAPI', '- Profiles']
1515
- ['SpotifyWebAPI/search.md', 'SpotifyWebAPI', '- Search']
1616
- ['SpotifyWebAPI/tracks.md', 'SpotifyWebAPI', '- Tracks']
17+
- ['SpotifyWebAPI/util.md', 'SpotifyWebAPI', '- Util']
1718
- ['SpotifyLocalAPI/index.md', 'SpotifyLocalAPI', 'SpotifyLocalAPI']
1819
repo_url: 'https://github.com/JohnnyCrazy/SpotifyAPI-NET'
1920
site_author: 'JohnnyCrazy'

0 commit comments

Comments
 (0)