public IHttpActionResult Put([FromODataUri] System.Guid key, [FromBody] OrderLine entity) { logger.Trace("Call OrderLineController Put"); var price = productPriceRepository.GetByProductId(entity.ItemId); if (price != null) { entity.Price = (float)price.Price; entity.Amount = entity.Qty * entity.Price; } var record = orderLineRepository.Update(entity); Task.Factory.StartNew(() => RecalcOrderAsync(entity.OrderId)); return(Updated(record)); }