public IHttpActionResult Get([FromODataUri] int key) { DeltaEnumCustomer customer = GetCustomers().FirstOrDefault(e => e.Id == key); if (customer != null) { return(Ok(customer)); } else { return(NotFound()); } }
public IHttpActionResult Patch([FromODataUri] int key, Delta <DeltaEnumCustomer> patch) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } DeltaEnumCustomer customer = GetCustomers().FirstOrDefault(e => e.Id == key); if (customer == null) { return(NotFound()); } patch.Patch(customer); return(Updated(customer)); }