Beispiel #1
0
        public async Task <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 = await orderLineRepository.UpdateAsync(entity);

            await Task.Factory.StartNew(() => RecalcOrderAsync(entity.OrderId));

            return(Updated(record));
        }