private void OnOrderLineAdded(OrderLineAddedEvent e) { if (orderLines == null) { orderLines = new List <OrderLine>(); } orderLines.Add(new OrderLine(e.RowId, e.Quantity, e.TotalAmount)); }
public void AddOrderItem(int quantity, decimal totalAmount, string customerName, string productName, Guid productId, Guid customerId) { var e = new OrderLineAddedEvent { Quantity = quantity, TotalAmount = totalAmount, ProductId = productId }; Apply <OrderLineAddedEvent>(e) .Save <CustomerOrdersDetailReport>(x => { x.AggregateRootId = this.AggregateRootId; x.RowId = e.RowId; x.CustomerName = customerName; x.ProductName = productName; x.Quantity = quantity; x.TotalAmount = totalAmount; x.ProductId = productId; x.CustomerId = customerId; } ); }