static void Main(string[] args) { new EventStoreConfiguration() .ConfigureTransport <EventStoreTransportConnectionString>() .ConfigureSubscriptions( InventoryItemStockHandler.Subscriptions().PublisherBySubscription.Keys.AsEnumerable(), RefundProductOrderHandler.Subscriptions().PublisherBySubscription.Keys.AsEnumerable()); var uri = new Uri("http://localhost:3785"); using (var host = new NancyHost( uri, new DefaultNancyBootstrapper(), new HostConfiguration { UrlReservations = new UrlReservations() { CreateAutomatically = true } })) { host.Start(); Console.WriteLine("Your application is running on " + uri); Console.WriteLine("Press any [Enter] to close the Api Host."); Console.ReadLine(); } }
public CanDeactivateAStockedItem() { _notificationsByPublisher = InventoryItemStockHandler .Subscriptions() .PublisherBySubscription .Given( new InventoryItemCreated { Id = "1" }, new ItemsCheckedInToInventory { Id = "1", Count = 10 }) .Notify(new Placed <DeactivateInventoryItem> { Command = new DeactivateInventoryItem { Id = "1" } }); }