Added Async and new Helper Docs

This commit is contained in:
Johnny @PC 2015-11-07 20:44:36 +01:00
parent c3e8a33db8
commit 8d4f15a28f
3 changed files with 30 additions and 0 deletions

View File

@ -59,6 +59,17 @@ if (profile.HasError())
}
```
##Asynchronous
Every API-Call now has an asynchronous method. Just append `Async` to the Method-Name.
Example:
```cs
public async void Test()
{
var profile = await _spotify.GetPrivateProfileAsync();
Console.WriteLine(profile.DisplayName);
}
```
---
##API-Reference
@ -120,3 +131,6 @@ if (profile.HasError())
###Tracks
* [GetSeveralTracks](/SpotifyWebAPI/tracks#getseveraltracks)
* [GetTrack](/SpotifyWebAPI/tracks#gettrack)
###Util
* [Utility-Functions](/SpotifyWebAPI/util)

View File

@ -0,0 +1,15 @@
##Paging-Methods
The `SpotifyWebAPI` features two paging-helper Methods, `GetNextPage()` and `GetPreviousPage()`.
Both are an easy way to receive the next/previous page of a Paging-Object.
Sample:
````csharp
var playlistTracks = _spotify.GetPlaylistTracks("1122095781", "4EcNf2l8rXInbJOf3tQdgU", "", 50);
while (true)
{
Console.WriteLine(playlistTracks.Items.Count);
if (!playlistTracks.HasNextPage())
break;
playlistTracks = _spotify.GetNextPage(playlistTracks);
}
````

View File

@ -14,6 +14,7 @@ pages:
- ['SpotifyWebAPI/profiles.md', 'SpotifyWebAPI', '- Profiles']
- ['SpotifyWebAPI/search.md', 'SpotifyWebAPI', '- Search']
- ['SpotifyWebAPI/tracks.md', 'SpotifyWebAPI', '- Tracks']
- ['SpotifyWebAPI/util.md', 'SpotifyWebAPI', '- Util']
- ['SpotifyLocalAPI/index.md', 'SpotifyLocalAPI', 'SpotifyLocalAPI']
repo_url: 'https://github.com/JohnnyCrazy/SpotifyAPI-NET'
site_author: 'JohnnyCrazy'