diff --git a/Using Business Objects in the Report/Startup.cs b/Using Business Objects in the Report/Startup.cs index b59ece4..b391574 100644 --- a/Using Business Objects in the Report/Startup.cs +++ b/Using Business Objects in the Report/Startup.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; @@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; namespace Using_Business_Objects_in_the_Report { @@ -21,32 +22,34 @@ public Startup(IConfiguration configuration) // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - services.AddMemoryCache(); - services.AddSession(); - services.AddMvc(); + services.AddControllersWithViews(); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); - app.UseBrowserLink(); } 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.UseMvc(routes => + app.UseRouting(); + + app.UseEndpoints(endpoints => { - routes.MapRoute( + endpoints.MapControllerRoute( name: "default", - template: "{controller=Viewer}/{action=Index}/{id?}"); + pattern: "{controller=Home}/{action=Index}/{id?}"); }); + } } } diff --git a/Using Business Objects in the Report/Using Business Objects in the Report.csproj b/Using Business Objects in the Report/Using Business Objects in the Report.csproj index 34ef9ff..eb6099b 100644 --- a/Using Business Objects in the Report/Using Business Objects in the Report.csproj +++ b/Using Business Objects in the Report/Using Business Objects in the Report.csproj @@ -1,16 +1,15 @@ - netcoreapp2.0 + netcoreapp3.1 - - +