public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseFileServer();

            app.UseMvcWithDefaultRoute();

            app.Run(async(context) =>
            {
                await context.Response.WriteAsync("Hello World!");
            });

            ModuleEvents = new MvcCoreSampleModuleEvents();
            var modulesConfig = Configuration.Get <AppSettings>();

            if (modulesConfig?.ExtensibilityModules == null)
            {
                return;
            }
            foreach (var moduleConfig in modulesConfig?.ExtensibilityModules)
            {
                var module = Activator.CreateInstance(Type.GetType(moduleConfig.Type)) as ICoreModule;
                if (module != null)
                {
                    module.Initialize(ModuleEvents);
                }
            }
        }
Exemple #2
0
 public void Initialize(MvcCoreSampleModuleEvents moduleEvents)
 {
     moduleEvents.PreSubmitMovie += OnPreSubmitMovie;
 }