Esempio n. 1
0
        private static void Main(string[] args)
        {
            ILogger logger = new EmptyLogger();
            var container = new UnityContainer();
            try
            {
                container
                    .ConfigureLogger()
                    .ConfigureReadModel()
                    .ConfigureEventStore()
                    .ConfigureCommonDomain()
                    .ConfigureBus();

                logger = container.Resolve<ILogger>();
                logger.LogInfo(Program.LOGGER_NAME, "Configuration ended");

            }
            catch (Exception e)
            {
                logger.LogException(Program.LOGGER_NAME, e);
            }
            finally
            {
                logger.LogInfo(Program.LOGGER_NAME, "Press key to continue..");
                Console.ReadLine();
                logger.LogInfo(Program.LOGGER_NAME, "Worker shutdown..");
                var disposable = container.Resolve<IServiceBus>() as IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }