Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save phillippelevidad/e36abbb9e3dde08f4380a393b3182165 to your computer and use it in GitHub Desktop.
Save phillippelevidad/e36abbb9e3dde08f4380a393b3182165 to your computer and use it in GitHub Desktop.
UpdateCustomer API endpoint.
[HttpPut("customers")]
public JsonResult UpdateCustomer(Customer customer)
{
if (ModelState.IsValid)
{
// Consumers are able to set Customer.Level as they can do with every other property added now and in the future.
customerRepository.Update(customer);
return Ok();
}
return BadRequest();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment