Example #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                app.UseHsts();
            }
            app.UseHttpsRedirection();
            app.UseStaticFiles();

            app.UseRouting();

            app.UseAuthentication();
            app.UseAuthorization();

            app.UseSession();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();

                // endpoints.MapControllerRoute(
                //     name: "web",
                //     pattern: "web/{c?}/{a?}",
                //     defaults: new { controller = "App", action = "Index" });

                endpoints.MapControllerRoute(
                    name: "studio",
                    pattern: "entitystudio/{a}/{id?}",
                    defaults: new { controller = "EntityStudio", action = "Index" });

                endpoints.MapControllerRoute(
                    name: "default",
                    pattern: "{controller=Entity}/{action=Index}/{id?}");
            });

            //app.InitStackApp(this.Configuration);
            StackErp.Core.App.ConfigureDB(this.Configuration.GetValue <string>("DBInfo:ConnectionString"));

            EntityMetaData.Build();
            ViewModel.RegisterStackScriptRef.Register();
        }
        public override AnyStatus OnSaveComplete(StackAppContext appContext, EntityModelBase model)
        {
            EntityMetaData.Build();

            return(base.OnSaveComplete(appContext, model));
        }