diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Areas/Identity/RevalidatingIdentityAuthenticationStateProvider.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Areas/Identity/RevalidatingIdentityAuthenticationStateProvider.cs index 1921a7f41662..f930d612fd3d 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Areas/Identity/RevalidatingIdentityAuthenticationStateProvider.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Areas/Identity/RevalidatingIdentityAuthenticationStateProvider.cs @@ -1,13 +1,8 @@ -using System; using System.Security.Claims; -using System.Threading; -using System.Threading.Tasks; using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Components.Server; using Microsoft.AspNetCore.Identity; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace BlazorServerWeb_CSharp.Areas.Identity diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/ApplicationDbContext.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/ApplicationDbContext.cs index 622de664e0a7..b8b1d8434a01 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/ApplicationDbContext.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/ApplicationDbContext.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; namespace BlazorServerWeb_CSharp.Data diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecast.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecast.cs index b5247b3cdfb7..c9b3052b7581 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecast.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecast.cs @@ -1,5 +1,3 @@ -using System; - namespace BlazorServerWeb_CSharp.Data { public class WeatherForecast diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecastService.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecastService.cs index 5749009ea6d9..4cdc4e4e3cca 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecastService.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecastService.cs @@ -1,7 +1,3 @@ -using System; -using System.Linq; -using System.Threading.Tasks; - namespace BlazorServerWeb_CSharp.Data { public class WeatherForecastService diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.cshtml.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.cshtml.cs index f31173281588..230136caaf33 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.cshtml.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.cshtml.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; +using System.Diagnostics; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.Extensions.Logging; namespace BlazorServerWeb_CSharp.Pages { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Program.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Program.cs index a7d6854d0ba3..23d881bc3b1e 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Program.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; #if (OrganizationalAuth || IndividualB2CAuth) using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.OpenIdConnect; @@ -14,23 +10,18 @@ #endif using Microsoft.AspNetCore.Authorization; #endif -using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Components; #if (IndividualLocalAuth) using Microsoft.AspNetCore.Components.Authorization; using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity.UI; #endif -using Microsoft.AspNetCore.Hosting; #if (OrganizationalAuth) using Microsoft.AspNetCore.Mvc.Authorization; #endif #if (IndividualLocalAuth) using Microsoft.EntityFrameworkCore; #endif -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; #if (GenerateGraph) using Graph = Microsoft.Graph; #endif diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Program.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Program.cs index a756324094d3..c66840010a5e 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Program.cs @@ -1,15 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Net.Http; -using System.Text; -using System.Threading.Tasks; #if (!NoAuth && Hosted) using Microsoft.AspNetCore.Components.WebAssembly.Authentication; #endif using Microsoft.AspNetCore.Components.WebAssembly.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; #if (Hosted) using ComponentsWebAssembly_CSharp.Client; #else diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Controllers/OidcConfigurationController.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Controllers/OidcConfigurationController.cs index 273fda395ccc..c279b40060a8 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Controllers/OidcConfigurationController.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Controllers/OidcConfigurationController.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.ApiAuthorization.IdentityServer; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; namespace ComponentsWebAssembly_CSharp.Server.Controllers { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Controllers/WeatherForecastController.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Controllers/WeatherForecastController.cs index 8e93ef94c129..46dd2a8b2f37 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Controllers/WeatherForecastController.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Controllers/WeatherForecastController.cs @@ -1,21 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -#if (!NoAuth) +#if (!NoAuth) using Microsoft.AspNetCore.Authorization; #endif #if (GenerateApi) -using Microsoft.Extensions.Configuration; using Microsoft.Identity.Web; using System.Net; -using System.Net.Http; #endif #if (GenerateGraph) using Microsoft.Graph; #endif using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; #if (OrganizationalAuth || IndividualB2CAuth) using Microsoft.Identity.Web.Resource; #endif diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/ApplicationDbContext.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/ApplicationDbContext.cs index ed95c4aba5a8..26ed9ba32ace 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/ApplicationDbContext.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/ApplicationDbContext.cs @@ -1,12 +1,8 @@ -using ComponentsWebAssembly_CSharp.Server.Models; -using IdentityServer4.EntityFramework.Options; -using Microsoft.AspNetCore.ApiAuthorization.IdentityServer; +using Microsoft.AspNetCore.ApiAuthorization.IdentityServer; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +using IdentityServer4.EntityFramework.Options; +using ComponentsWebAssembly_CSharp.Server.Models; namespace ComponentsWebAssembly_CSharp.Server.Data { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Models/ApplicationUser.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Models/ApplicationUser.cs index 216c5b31692d..25fb8e993271 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Models/ApplicationUser.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Models/ApplicationUser.cs @@ -1,8 +1,4 @@ using Microsoft.AspNetCore.Identity; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace ComponentsWebAssembly_CSharp.Server.Models { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Pages/Error.cshtml.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Pages/Error.cshtml.cs index 7f7954b08457..ae2531630485 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Pages/Error.cshtml.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Pages/Error.cshtml.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; +using System.Diagnostics; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.Extensions.Logging; namespace ComponentsWebAssembly_CSharp.Server.Pages { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Program.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Program.cs index 81337ad83cc1..a5ea1af099e8 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Program.cs @@ -1,19 +1,13 @@ -using System.Linq; -#if (OrganizationalAuth || IndividualB2CAuth || IndividualLocalAuth) +#if (OrganizationalAuth || IndividualB2CAuth || IndividualLocalAuth) using Microsoft.AspNetCore.Authentication; #endif #if (OrganizationalAuth || IndividualB2CAuth) using Microsoft.AspNetCore.Authentication.JwtBearer; #endif -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.ResponseCompression; #if (IndividualLocalAuth) using Microsoft.EntityFrameworkCore; #endif -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; #if (GenerateGraph) using Graph = Microsoft.Graph; #endif diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Shared/WeatherForecast.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Shared/WeatherForecast.cs index 9f0d7ac7a405..3e26a36fdfc9 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Shared/WeatherForecast.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Shared/WeatherForecast.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ComponentsWebAssembly_CSharp.Shared +namespace ComponentsWebAssembly_CSharp.Shared { public class WeatherForecast { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Program.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Program.cs index ba1fabff931e..80c541d22708 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Program.cs @@ -1,7 +1,3 @@ -using System; -using Microsoft.AspNetCore.Builder; -using Microsoft.Extensions.Hosting; - var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Program.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Program.cs index 0036b6b5b0dc..5922b70b5bac 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Program.cs @@ -1,12 +1,3 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; using GrpcService_CSharp.Services; var builder = WebApplication.CreateBuilder(args); diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Services/GreeterService.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Services/GreeterService.cs index e9254c829118..39c967545928 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Services/GreeterService.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Services/GreeterService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Grpc.Core; -using Microsoft.Extensions.Logging; using GrpcService_CSharp; namespace GrpcService_CSharp.Services diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml.cs index 83e6e0edb220..4bc36c20a93a 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; namespace Company.RazorClassLibrary1.MyFeature.Pages diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/ExampleJsInterop.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/ExampleJsInterop.cs index 769455838f24..500703f77222 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/ExampleJsInterop.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/ExampleJsInterop.cs @@ -1,5 +1,3 @@ -using System; -using System.Threading.Tasks; using Microsoft.JSInterop; namespace Company.RazorClassLibrary1 diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Data/ApplicationDbContext.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Data/ApplicationDbContext.cs index a33a15e3e906..d883b6ecc1f8 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Data/ApplicationDbContext.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Data/ApplicationDbContext.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; namespace Company.WebApplication1.Data diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Error.cshtml.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Error.cshtml.cs index 121dc6440ee1..631c911ffae0 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Error.cshtml.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Error.cshtml.cs @@ -1,11 +1,6 @@ -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.Extensions.Logging; namespace Company.WebApplication1.Pages { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Index.cshtml.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Index.cshtml.cs index 35b806d386ca..87d7e464a0a1 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Index.cshtml.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Index.cshtml.cs @@ -1,19 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -#if (GenerateApiOrGraph) -using Microsoft.Extensions.Configuration; -using Microsoft.Identity.Web; +#if (GenerateApiOrGraph) using System.Net; -using System.Net.Http; #endif +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; #if (GenerateGraph) using Microsoft.Graph; #endif -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.Extensions.Logging; +#if (GenerateApiOrGraph) +using Microsoft.Identity.Web; +#endif namespace Company.WebApplication1.Pages { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Privacy.cshtml.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Privacy.cshtml.cs index 9816502ea14b..5fa47ed6751d 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Privacy.cshtml.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Privacy.cshtml.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.Extensions.Logging; namespace Company.WebApplication1.Pages { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Program.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Program.cs index 731984c6831f..fa673e0876b1 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Program.cs @@ -1,16 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; #if (OrganizationalAuth || IndividualB2CAuth) using Microsoft.AspNetCore.Authentication; -using Microsoft.Identity.Web; -using Microsoft.Identity.Web.UI; using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.AspNetCore.Authorization; #endif -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; #if (IndividualLocalAuth) using Microsoft.AspNetCore.Identity; #endif @@ -20,10 +12,10 @@ #if (IndividualLocalAuth) using Microsoft.EntityFrameworkCore; #endif -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; +#if (OrganizationalAuth || IndividualB2CAuth) +using Microsoft.Identity.Web; +using Microsoft.Identity.Web.UI; +#endif #if (MultiOrgAuth) using Microsoft.IdentityModel.Tokens; #endif diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Controllers/HomeController.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Controllers/HomeController.cs index 4aea265a2e8f..25632ef42779 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Controllers/HomeController.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Controllers/HomeController.cs @@ -1,22 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Threading.Tasks; -#if (OrganizationalAuth) -using Microsoft.AspNetCore.Authorization; -#endif +using System.Diagnostics; #if (GenerateApiOrGraph) -using Microsoft.Extensions.Configuration; -using Microsoft.Identity.Web; using System.Net; -using System.Net.Http; #endif +#if (OrganizationalAuth) +using Microsoft.AspNetCore.Authorization; +#endif +using Microsoft.AspNetCore.Mvc; #if (GenerateGraph) using Microsoft.Graph; #endif -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; +#if (GenerateApiOrGraph) +using Microsoft.Identity.Web; +#endif using Company.WebApplication1.Models; namespace Company.WebApplication1.Controllers diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Data/ApplicationDbContext.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Data/ApplicationDbContext.cs index a33a15e3e906..d883b6ecc1f8 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Data/ApplicationDbContext.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Data/ApplicationDbContext.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; namespace Company.WebApplication1.Data diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Models/ErrorViewModel.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Models/ErrorViewModel.cs index 665acaf669be..bfa680309b18 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Models/ErrorViewModel.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Models/ErrorViewModel.cs @@ -1,5 +1,3 @@ -using System; - namespace Company.WebApplication1.Models { public class ErrorViewModel diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Program.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Program.cs index bb593301421c..30cf4835b012 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Program.cs @@ -1,16 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; #if (OrganizationalAuth || IndividualB2CAuth) using Microsoft.AspNetCore.Authentication; -using Microsoft.Identity.Web; -using Microsoft.Identity.Web.UI; -using Microsoft.AspNetCore.Authentication.OpenIdConnect; using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Authentication.OpenIdConnect; #endif -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; #if (IndividualLocalAuth) using Microsoft.AspNetCore.Identity; #endif @@ -20,10 +12,10 @@ #if (IndividualLocalAuth) using Microsoft.EntityFrameworkCore; #endif -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; +#if (OrganizationalAuth || IndividualB2CAuth) +using Microsoft.Identity.Web; +using Microsoft.Identity.Web.UI; +#endif #if (MultiOrgAuth) using Microsoft.IdentityModel.Tokens; #endif diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherForecastController.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherForecastController.cs index b17adf71737b..8546a92a571e 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherForecastController.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherForecastController.cs @@ -1,24 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; +#if (GenerateApi) +using System.Net.Http; +#endif #if (!NoAuth) using Microsoft.AspNetCore.Authorization; #endif +using Microsoft.AspNetCore.Mvc; #if (GenerateApi) -using Microsoft.Extensions.Configuration; using Microsoft.Identity.Web; -using System.Net; -using System.Net.Http; #endif -#if (GenerateGraph) -using Microsoft.Graph; -#endif -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; #if (OrganizationalAuth || IndividualB2CAuth) using Microsoft.Identity.Web.Resource; #endif +#if (GenerateGraph) +using Microsoft.Graph; +#endif namespace Company.WebApplication1.Controllers { diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Program.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Program.cs index 21f4f7dfdd27..f73759e04106 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Program.cs @@ -1,18 +1,13 @@ -using System; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; #if (OrganizationalAuth || IndividualB2CAuth) using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.Identity.Web; #endif -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; #if (GenerateGraph) using Graph = Microsoft.Graph; #endif +#if (OrganizationalAuth || IndividualB2CAuth) +using Microsoft.Identity.Web; +#endif #if (EnableOpenAPI) using Microsoft.OpenApi.Models; #endif diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/WeatherForecast.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/WeatherForecast.cs index 7ff35e1a61bc..147bef00be26 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/WeatherForecast.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/WeatherForecast.cs @@ -1,5 +1,3 @@ -using System; - namespace Company.WebApplication1 { public class WeatherForecast diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/Program.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/Program.cs index c8c061803ccf..52f7e3e88e2b 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/Program.cs @@ -1,5 +1,3 @@ -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; using Company.Application1; IHost host = Host.CreateDefaultBuilder(args) diff --git a/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/Worker.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/Worker.cs index de17471514c4..a0c03d969faf 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/Worker.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/Worker.cs @@ -1,11 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; - namespace Company.Application1 { public class Worker : BackgroundService