static void Main(string[] args)
        {
            using (SalesDB context = new SalesDB())
            {
                EnsureMember(context.GetMemberRepository());
                Rebate rebate = EnsureRebate(context.GetRebateRepository());
                EnsureProduct(rebate, context.GetProductRepository());
            }

            Console.WriteLine("Subscribing to events...");

            var queue = new MsmqMessageQueueOutbound <Subscription>(
                ".",
                typeof(OrderShipped).FullName);

            queue.Send(new Subscription
            {
                Target    = Environment.MachineName,
                QueueName = typeof(OrderShippedSubscriber).FullName
            });

            Console.WriteLine("Starting order shipped subscriber...");

            MessageProcessor <OrderShipped> processor =
                new MessageProcessor <OrderShipped>(
                    typeof(OrderShippedSubscriber).FullName,
                    () => new OrderShippedSubscriber());

            processor.Start();

            Console.ReadKey();

            processor.Stop();
        }
        public OrderShippedSubscriber()
        {
            _context = new SalesDB();

            _salesHistoryService = new SalesHistoryService(
                _context.GetMemberRepository(),
                _context.GetMeasurementPeriodRepository(),
                _context.GetProductRepository(),
                _context.GetSalesHistoryRepository()
                );
        }