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