C# Class Hypermedia.Sample.Client.HypermediaSampleClient

Inheritance: IDisposable
显示文件 Open project: cosullivan/Hypermedia Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

GetCommentsByPostIdAsync ( int postId, CancellationToken cancellationToken = default(CancellationToken) ) : Task>

Return the comments for the given post ID.

GetPostByIdAsync ( int id, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Return the post with the given resource ID.

GetPostsAsync ( int skip, int take = 10, CancellationToken cancellationToken = default(CancellationToken) ) : Task>

Returns a list of posts.

GetUserByIdAsync ( int id, CancellationToken cancellationToken = default(CancellationToken) ) : Task

Return the user with the given resource ID.

GetUsersAsync ( int skip, int take = 10, CancellationToken cancellationToken = default(CancellationToken) ) : Task>

Returns a list of users.

HypermediaSampleClient ( string endpoint, string accessToken ) : System

Constructor.

Private Methods

Method Description
CreateResolver ( ) : IContractResolver

Returns the resource contract resolver for the known types.

Method Details

Dispose() public method

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
return void

GetCommentsByPostIdAsync() public method

Return the comments for the given post ID.
public GetCommentsByPostIdAsync ( int postId, CancellationToken cancellationToken = default(CancellationToken) ) : Task>
postId int The ID of the post to return the comments for.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task>

GetPostByIdAsync() public method

Return the post with the given resource ID.
public GetPostByIdAsync ( int id, CancellationToken cancellationToken = default(CancellationToken) ) : Task
id int The ID of the post to return.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

GetPostsAsync() public method

Returns a list of posts.
public GetPostsAsync ( int skip, int take = 10, CancellationToken cancellationToken = default(CancellationToken) ) : Task>
skip int The number of posts to skip from the start.
take int The number of posts to return.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task>

GetUserByIdAsync() public method

Return the user with the given resource ID.
public GetUserByIdAsync ( int id, CancellationToken cancellationToken = default(CancellationToken) ) : Task
id int The ID of the user to return.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task

GetUsersAsync() public method

Returns a list of users.
public GetUsersAsync ( int skip, int take = 10, CancellationToken cancellationToken = default(CancellationToken) ) : Task>
skip int The number of users to skip from the start.
take int The number of users to return.
cancellationToken System.Threading.CancellationToken The cancellation token.
return Task>

HypermediaSampleClient() public method

Constructor.
public HypermediaSampleClient ( string endpoint, string accessToken ) : System
endpoint string The endpoint to connect the client to.
accessToken string The access token.
return System