void On(EventEnvelope <InventoryItemRenamed> e) => items[e.Stream].Name = e.Event.NewName;
void On(EventEnvelope <InventoryItemCheckedOut> e) => items[e.Stream].Total -= e.Event.Quantity;
void On(EventEnvelope <InventoryItemDeactivated> e) => items[e.Stream].Active = false;
void On(EventEnvelope <InventoryItemCreated> e) => items[e.Stream] = new InventoryItemDetails(e.Event.Name, 0, true);
async Task On(EventEnvelope <InventoryItemRenamed> e) => await System.ActorOf <IInventory>("#").Tell(new RenameItem(e.Stream, e.Event.NewName));
async Task On(EventEnvelope <InventoryItemDeactivated> e) => await System.ActorOf <IInventory>("#").Tell(new DiscontinueItem(e.Stream));
async Task On(EventEnvelope <InventoryItemCheckedOut> e) => await System.ActorOf <IInventory>("#").Tell(new DecrementStockLevel(e.Stream, e.Event.Quantity));
async Task On(EventEnvelope <InventoryItemCreated> e) => await System.ActorOf <IInventory>("#").Tell(new TrackStockOfNewInventoryItem(e.Stream, e.Event.Name));