Skip to content

Instantly share code, notes, and snippets.

@GregOnNet
Last active December 16, 2015 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GregOnNet/5470754 to your computer and use it in GitHub Desktop.
Save GregOnNet/5470754 to your computer and use it in GitHub Desktop.
public HttpResponseMessage Get(int id)
{
return CustomerRepository.GetBy(id)
.Match(
c => Request.CreateResponse(
HttpStatusCode.Found,
c),
() => Request.CreateErrorResponse(
HttpStatusCode.NotFound,
String.Format("There is no customer having the ID '{0}'", id)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment