Example #1
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseStatusCodePages();
            }

            app.UseStaticFiles();
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: null,
                    template: "{controller=Product}/{action=List}/Page{productPage}/{pageSize:int}"
                    );
                routes.MapRoute(
                    name: null,
                    template: "{controller=Product}/{action=List}/Page{productPage:int}"
                    );
                routes.MapRoute(
                    name: null,
                    template: "{controller=Product}/{action=List}/{pageSize:int}"
                    );
                routes.MapRoute(
                    name: null,
                    template: "{controller=Product}/{action=List}"
                    );
            });
            SeedDataCategory.EnsurePopulated(app);
            SeedDataProduct.EnsurePopulated(app);
        }