Skip to content

Instantly share code, notes, and snippets.

@scichelli
Created January 11, 2014 20:14
Show Gist options
  • Save scichelli/8376113 to your computer and use it in GitHub Desktop.
Save scichelli/8376113 to your computer and use it in GitHub Desktop.
public class MyCoolService
{
public Result<CoolThing> Fetch(Uri uri)
{
HttpResponseMessage response = CallThatThingInTheCloud(uri);
return response.IsSuccessStatusCode
? Result<CoolThing>.Success(Deserialize(response))
: Result<CoolThing>.Error(response.StatusCode, response.ReasonPhrase);
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment