This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UserApiClient : BaseApiClient | |
{ | |
// Example of making a call to API in order to get a user by ID | |
public Task<User> GetUser(int Id) | |
{ | |
// using RunWithConnectionCloser will call ServicePoint.CloseConnectionGroup as long as there are no other pending operations. | |
// Its important that all service calls are wrapped with RunWithConnectionCloser | |
return BaseApiClient.RunWithConnectionCloser (() => { | |
// Make service call using RestSharp (what I'm using), HttpWebRequest, HttpClient, or whatever |