Created
August 14, 2020 11:55
-
-
Save corespider/a09a68f97816766880c3d7f2e5048890 to your computer and use it in GitHub Desktop.
ASP NET WEB API Get Customer By ID
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
[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