Last active
March 24, 2017 10:35
-
-
Save jfversluis/b4de1f3bc1117c86d3b14a7e8f012da3 to your computer and use it in GitHub Desktop.
Invoking the Refit code
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
using Refit; | |
using System; | |
using System.Net.Http; | |
using System.Threading.Tasks; | |
namespace RefitTestApp | |
{ | |
public class RestClient | |
{ | |
private readonly IRestClient _restClient; | |
public RestClient () | |
{ | |
_restClient = RestService.For<IRestClient> ("https://jsonplaceholder.typicode.com"); | |
} | |
public async Task<Foo []> GetPosts () | |
{ | |
return await _restClient.GetPosts (); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment