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 f930d612fd3d..1921a7f41662 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,8 +1,13 @@ +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 b8b1d8434a01..622de664e0a7 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/ApplicationDbContext.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/ApplicationDbContext.cs @@ -1,4 +1,7 @@ -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Text; +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 c9b3052b7581..b5247b3cdfb7 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecast.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecast.cs @@ -1,3 +1,5 @@ +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 4cdc4e4e3cca..5749009ea6d9 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecastService.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecastService.cs @@ -1,3 +1,7 @@ +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 230136caaf33..f31173281588 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,6 +1,11 @@ -using System.Diagnostics; +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 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 23d881bc3b1e..a7d6854d0ba3 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Program.cs @@ -1,3 +1,7 @@ +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; @@ -10,18 +14,23 @@ #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 c66840010a5e..a756324094d3 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Program.cs @@ -1,7 +1,15 @@ +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 c279b40060a8..273fda395ccc 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,5 +1,6 @@ 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 46dd2a8b2f37..8e93ef94c129 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,14 +1,21 @@ -#if (!NoAuth) +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +#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 26ed9ba32ace..ed95c4aba5a8 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,8 +1,12 @@ -using Microsoft.AspNetCore.ApiAuthorization.IdentityServer; +using ComponentsWebAssembly_CSharp.Server.Models; +using IdentityServer4.EntityFramework.Options; +using Microsoft.AspNetCore.ApiAuthorization.IdentityServer; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; -using IdentityServer4.EntityFramework.Options; -using ComponentsWebAssembly_CSharp.Server.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; 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 25fb8e993271..216c5b31692d 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,4 +1,8 @@ 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 ae2531630485..7f7954b08457 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,6 +1,11 @@ -using System.Diagnostics; +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 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 a5ea1af099e8..81337ad83cc1 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Program.cs @@ -1,13 +1,19 @@ -#if (OrganizationalAuth || IndividualB2CAuth || IndividualLocalAuth) +using System.Linq; +#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 3e26a36fdfc9..9f0d7ac7a405 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Shared/WeatherForecast.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Shared/WeatherForecast.cs @@ -1,4 +1,8 @@ -namespace ComponentsWebAssembly_CSharp.Shared +using System; +using System.Collections.Generic; +using System.Text; + +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 80c541d22708..ba1fabff931e 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/EmptyWeb-CSharp/Program.cs @@ -1,3 +1,7 @@ +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 5922b70b5bac..0036b6b5b0dc 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Program.cs @@ -1,3 +1,12 @@ +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 39c967545928..e9254c829118 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Services/GreeterService.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Services/GreeterService.cs @@ -1,4 +1,9 @@ +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 4bc36c20a93a..83e6e0edb220 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,4 +1,8 @@ -using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +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 500703f77222..769455838f24 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/ExampleJsInterop.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/ExampleJsInterop.cs @@ -1,3 +1,5 @@ +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 d883b6ecc1f8..a33a15e3e906 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Data/ApplicationDbContext.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Data/ApplicationDbContext.cs @@ -1,4 +1,7 @@ -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Text; +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 631c911ffae0..121dc6440ee1 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,6 +1,11 @@ +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 87d7e464a0a1..35b806d386ca 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,14 +1,19 @@ -#if (GenerateApiOrGraph) +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +#if (GenerateApiOrGraph) +using Microsoft.Extensions.Configuration; +using Microsoft.Identity.Web; using System.Net; +using System.Net.Http; #endif -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.RazorPages; #if (GenerateGraph) using Microsoft.Graph; #endif -#if (GenerateApiOrGraph) -using Microsoft.Identity.Web; -#endif +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/Privacy.cshtml.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Privacy.cshtml.cs index 5fa47ed6751d..9816502ea14b 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,5 +1,10 @@ -using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +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/Program.cs b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Program.cs index fa673e0876b1..731984c6831f 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Program.cs @@ -1,8 +1,16 @@ +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 @@ -12,10 +20,10 @@ #if (IndividualLocalAuth) using Microsoft.EntityFrameworkCore; #endif -#if (OrganizationalAuth || IndividualB2CAuth) -using Microsoft.Identity.Web; -using Microsoft.Identity.Web.UI; -#endif +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; #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 25632ef42779..4aea265a2e8f 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Controllers/HomeController.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Controllers/HomeController.cs @@ -1,17 +1,22 @@ -using System.Diagnostics; -#if (GenerateApiOrGraph) -using System.Net; -#endif +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading.Tasks; #if (OrganizationalAuth) using Microsoft.AspNetCore.Authorization; #endif -using Microsoft.AspNetCore.Mvc; -#if (GenerateGraph) -using Microsoft.Graph; -#endif #if (GenerateApiOrGraph) +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; 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 d883b6ecc1f8..a33a15e3e906 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Data/ApplicationDbContext.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Data/ApplicationDbContext.cs @@ -1,4 +1,7 @@ -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Text; +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 bfa680309b18..665acaf669be 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Models/ErrorViewModel.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Models/ErrorViewModel.cs @@ -1,3 +1,5 @@ +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 30cf4835b012..bb593301421c 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Program.cs @@ -1,8 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; #if (OrganizationalAuth || IndividualB2CAuth) using Microsoft.AspNetCore.Authentication; -using Microsoft.AspNetCore.Authorization; +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 @@ -12,10 +20,10 @@ #if (IndividualLocalAuth) using Microsoft.EntityFrameworkCore; #endif -#if (OrganizationalAuth || IndividualB2CAuth) -using Microsoft.Identity.Web; -using Microsoft.Identity.Web.UI; -#endif +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; #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 8546a92a571e..b17adf71737b 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherForecastController.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherForecastController.cs @@ -1,19 +1,24 @@ -#if (GenerateApi) -using System.Net.Http; -#endif +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; #if (!NoAuth) using Microsoft.AspNetCore.Authorization; #endif -using Microsoft.AspNetCore.Mvc; #if (GenerateApi) +using Microsoft.Extensions.Configuration; using Microsoft.Identity.Web; -#endif -#if (OrganizationalAuth || IndividualB2CAuth) -using Microsoft.Identity.Web.Resource; +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 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 f73759e04106..21f4f7dfdd27 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Program.cs @@ -1,13 +1,18 @@ +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 147bef00be26..7ff35e1a61bc 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/WeatherForecast.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/WeatherForecast.cs @@ -1,3 +1,5 @@ +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 52f7e3e88e2b..c8c061803ccf 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/Program.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/Program.cs @@ -1,3 +1,5 @@ +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 a0c03d969faf..de17471514c4 100644 --- a/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/Worker.cs +++ b/src/ProjectTemplates/Web.ProjectTemplates/content/Worker-CSharp/Worker.cs @@ -1,3 +1,11 @@ +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