protected void Application_Start() { ContextInitializer.Init(); AreaRegistration.RegisterAllAreas(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); }
public App() { var context = ContextInitializer.Init(); context.EventAggregator.Dispatcher = Dispatcher; TaskScheduler.UnobservedTaskException += TaskSchedulerUnobservedTaskException; AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException; Current.DispatcherUnhandledException += CurrentDispatcherUnhandledException; }
// 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); }
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(); }