Skip to content

Instantly share code, notes, and snippets.

@mdabbagh88
Forked from KyleGobel/RestSharpRX.cs
Created December 9, 2015 22:37
Show Gist options
  • Save mdabbagh88/62227fee46da9f5f581d to your computer and use it in GitHub Desktop.
Save mdabbagh88/62227fee46da9f5f581d to your computer and use it in GitHub Desktop.
Use RestSharp with ReactiveExtensions and Reactive UI
private IObservable<List<Client>> GetClients()
{
var request = new RestRequest("client/", Method.GET);
var subject = new AsyncSubject<List<Client>>();
_restClient.ExecuteAsync<ClientResponseDTO>(request, response =>
{
subject.OnNext(response.Data.Entities);
subject.OnCompleted();
});
return subject;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment