diff options
author | Damian Edwards <damian@damianedwards.com> | 2021-07-10 04:20:33 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-10 04:20:33 +0300 |
commit | d8bba727bdfaa3abf196c7f7c476966ed4af6692 (patch) | |
tree | 16c6085391e70b2fa304fe054ac4cc23ababc2c9 /src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp | |
parent | 952062eb2b2888b86a65b0e5fc4bc0651f3818c9 (diff) |
Remove usings from templates implicitly added by the SDK (#34219)
-Depends on dotnet/sdk#18459 flowing to dotnet/aspnetcore repo before we can merge this
- There's a couple of places we could remove usings from .razor files but need to verify the global usings flow into Razor compiler (#34217)
- Reordered usings in some places to ensure they get emitted in alphabetical order (modulo System.* & Microsoft.* coming before any others)
Diffstat (limited to 'src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp')
3 files changed, 10 insertions, 22 deletions
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 b17adf7173..8546a92a57 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 21f4f7dfdd..f73759e041 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 7ff35e1a61..147bef00be 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 |