Ejemplo n.º 1
0
        private static async Task Main(string[] args)
        {
            ConfigureLogger();

            _serviceProvider = ServiceCollectionFactory.CreateServiceProvider();
            _mediator        = _serviceProvider.GetService <IMediator>();

            AppDomain.CurrentDomain.ProcessExit += (s, ev) =>
            {
                Log.Information("Process exit...");
            };

            AssemblyLoadContext.Default.Unloading += context =>
            {
                _azureIoTHub.TryClose();
                Log.Information("Unloading...");
            };

            await InitializeAppliance();

            Log.Information("Home Security System started");

            // Sleep indefinitely
            Sleep(Infinite);
        }
Ejemplo n.º 2
0
        private static async Task Main(string[] args)
        {
            ConfigureLogger();

            _serviceProvider = ServiceCollectionFactory.CreateServiceProvider();
            _mediator        = _serviceProvider.GetService <IMediator>();

            await InitializeAppliance();

            // Sleep indefinitely
            Sleep(Infinite);
        }