Example #1
0
        protected void Application_Start()
        {
            ContextInitializer.Init();

            AreaRegistration.RegisterAllAreas();

            RegisterGlobalFilters(GlobalFilters.Filters);
            RegisterRoutes(RouteTable.Routes);
        }
Example #2
0
        public App()
        {
            var context = ContextInitializer.Init();

            context.EventAggregator.Dispatcher          = Dispatcher;
            TaskScheduler.UnobservedTaskException      += TaskSchedulerUnobservedTaskException;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException;
            Current.DispatcherUnhandledException       += CurrentDispatcherUnhandledException;
        }
Example #3
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();

            ContextInitializer.Init(services, Configuration);

            BrokerInitializer.Init(services, Configuration);

            ServicesInitializer.Init(services, Configuration);
        }
Example #4
0
        public static void Main(string[] args)
        {
            var host = BuildWebHost(args);

            using (var scope = host.Services.CreateScope())
            {
                var services = scope.ServiceProvider;
                try
                {
                    ContextInitializer.Init(services).Wait();
                }
                catch (Exception ex)
                {
                    var logger = services.GetRequiredService <ILogger <Program> >();
                    logger.LogError(ex, "An error occurred while seeding the database.");
                }
            }

            host.Run();
        }