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