private void OnNewProductCreated(NewProductCreatedEvent e) { if (e.ProductName != null) { this.productName = e.ProductName; } this.price = e.Price; this.stock = e.Stock; }
public void CreateNewProduct(string productName, decimal price, int stock) { var e = new NewProductCreatedEvent(productName, price, stock); Apply <NewProductCreatedEvent>(e) .Save <ProductDetailReport>(x => { x.AggregateRootId = AggregateRootId; x.ProductName = productName; x.Price = price; x.Stock = stock; } ); }