From ac5842391be5752040d795593fbfb94da72aea37 Mon Sep 17 00:00:00 2001 From: Arash zandi Date: Thu, 4 Jun 2020 08:41:49 -0700 Subject: [PATCH 1/5] Update Using Business Objects in the Report.csproj --- .../Using Business Objects in the Report.csproj | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 - - + From 038d73de1dfe167e8f2f2dbc564625ec7f3038ee Mon Sep 17 00:00:00 2001 From: Arash zandi Date: Thu, 4 Jun 2020 08:42:32 -0700 Subject: [PATCH 2/5] Update Startup.cs --- .../Startup.cs | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/Using Business Objects in the Report/Startup.cs b/Using Business Objects in the Report/Startup.cs index b59ece4..0391430 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; @@ -21,32 +21,37 @@ 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) { + 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.UseAuthorization(); + + app.UseEndpoints(endpoints => { - routes.MapRoute( + endpoints.MapControllerRoute( name: "default", - template: "{controller=Viewer}/{action=Index}/{id?}"); + pattern: "{controller=Home}/{action=Index}/{id?}"); }); + } } } From 5d443a4266eb1803b1ea028d83f637dc254a7686 Mon Sep 17 00:00:00 2001 From: Arash zandi Date: Thu, 4 Jun 2020 08:48:55 -0700 Subject: [PATCH 3/5] Update Startup.cs --- Using Business Objects in the Report/Startup.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Using Business Objects in the Report/Startup.cs b/Using Business Objects in the Report/Startup.cs index 0391430..520cc83 100644 --- a/Using Business Objects in the Report/Startup.cs +++ b/Using Business Objects in the Report/Startup.cs @@ -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 { @@ -25,7 +26,7 @@ public void ConfigureServices(IServiceCollection services) } // 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()) @@ -38,7 +39,7 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env) // 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.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRouting(); From ec1bdc2e608c0ed8a5b5d664d8c113254e43e7d6 Mon Sep 17 00:00:00 2001 From: Arash zandi Date: Thu, 4 Jun 2020 09:00:34 -0700 Subject: [PATCH 4/5] Update Startup.cs --- Using Business Objects in the Report/Startup.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Using Business Objects in the Report/Startup.cs b/Using Business Objects in the Report/Startup.cs index 520cc83..ce8b94f 100644 --- a/Using Business Objects in the Report/Startup.cs +++ b/Using Business Objects in the Report/Startup.cs @@ -28,24 +28,21 @@ public void ConfigureServices(IServiceCollection services) // 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 - { + // 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.UseAuthorization(); - app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( From 3035fe82910e939b9c7d7e0d47d842c67883dc3e Mon Sep 17 00:00:00 2001 From: Arash zandi Date: Thu, 4 Jun 2020 09:23:11 -0700 Subject: [PATCH 5/5] Update Startup.cs --- Using Business Objects in the Report/Startup.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Using Business Objects in the Report/Startup.cs b/Using Business Objects in the Report/Startup.cs index ce8b94f..b391574 100644 --- a/Using Business Objects in the Report/Startup.cs +++ b/Using Business Objects in the Report/Startup.cs @@ -28,16 +28,16 @@ public void ConfigureServices(IServiceCollection services) // 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 - //{ + 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. + //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();