Skip to content

Instantly share code, notes, and snippets.

@corespider
Created August 14, 2020 11:55
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 corespider/a09a68f97816766880c3d7f2e5048890 to your computer and use it in GitHub Desktop.
Save corespider/a09a68f97816766880c3d7f2e5048890 to your computer and use it in GitHub Desktop.
ASP NET WEB API Get Customer By ID
[ResponseType(typeof(Customer))]
public IHttpActionResult GetCustomer(int id)
{
Customer customer = db.Customers.Find(id);
if (customer == null)
{
return NotFound();
}
return Ok(customer);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment