Skip to content

Commit df76a76

Browse files
committed
Remove usings from templates implicitly added by the SDK
-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)
1 parent cb9ed02 commit df76a76

File tree

33 files changed

+46
-203
lines changed

33 files changed

+46
-203
lines changed

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Areas/Identity/RevalidatingIdentityAuthenticationStateProvider.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
1-
using System;
21
using System.Security.Claims;
3-
using System.Threading;
4-
using System.Threading.Tasks;
52
using Microsoft.AspNetCore.Components;
63
using Microsoft.AspNetCore.Components.Authorization;
74
using Microsoft.AspNetCore.Components.Server;
85
using Microsoft.AspNetCore.Identity;
9-
using Microsoft.Extensions.DependencyInjection;
10-
using Microsoft.Extensions.Logging;
116
using Microsoft.Extensions.Options;
127

138
namespace BlazorServerWeb_CSharp.Areas.Identity

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/ApplicationDbContext.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
1+
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
52
using Microsoft.EntityFrameworkCore;
63

74
namespace BlazorServerWeb_CSharp.Data

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecast.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using System;
2-
31
namespace BlazorServerWeb_CSharp.Data
42
{
53
public class WeatherForecast

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecastService.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
using System;
2-
using System.Linq;
3-
using System.Threading.Tasks;
4-
51
namespace BlazorServerWeb_CSharp.Data
62
{
73
public class WeatherForecastService

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Pages/Error.cshtml.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Diagnostics;
4-
using System.Linq;
5-
using System.Threading.Tasks;
1+
using System.Diagnostics;
62
using Microsoft.AspNetCore.Mvc;
73
using Microsoft.AspNetCore.Mvc.RazorPages;
8-
using Microsoft.Extensions.Logging;
94

105
namespace BlazorServerWeb_CSharp.Pages
116
{

src/ProjectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Program.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
51
#if (OrganizationalAuth || IndividualB2CAuth)
62
using Microsoft.AspNetCore.Authentication;
73
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
@@ -14,23 +10,18 @@
1410
#endif
1511
using Microsoft.AspNetCore.Authorization;
1612
#endif
17-
using Microsoft.AspNetCore.Builder;
1813
using Microsoft.AspNetCore.Components;
1914
#if (IndividualLocalAuth)
2015
using Microsoft.AspNetCore.Components.Authorization;
2116
using Microsoft.AspNetCore.Identity;
2217
using Microsoft.AspNetCore.Identity.UI;
2318
#endif
24-
using Microsoft.AspNetCore.Hosting;
2519
#if (OrganizationalAuth)
2620
using Microsoft.AspNetCore.Mvc.Authorization;
2721
#endif
2822
#if (IndividualLocalAuth)
2923
using Microsoft.EntityFrameworkCore;
3024
#endif
31-
using Microsoft.Extensions.Configuration;
32-
using Microsoft.Extensions.DependencyInjection;
33-
using Microsoft.Extensions.Hosting;
3425
#if (GenerateGraph)
3526
using Graph = Microsoft.Graph;
3627
#endif

src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/Program.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Net.Http;
4-
using System.Text;
5-
using System.Threading.Tasks;
61
#if (!NoAuth && Hosted)
72
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
83
#endif
94
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
10-
using Microsoft.Extensions.Configuration;
11-
using Microsoft.Extensions.DependencyInjection;
12-
using Microsoft.Extensions.Logging;
135
#if (Hosted)
146
using ComponentsWebAssembly_CSharp.Client;
157
#else

src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Controllers/OidcConfigurationController.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
22
using Microsoft.AspNetCore.Mvc;
3-
using Microsoft.Extensions.Logging;
43

54
namespace ComponentsWebAssembly_CSharp.Server.Controllers
65
{

src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Controllers/WeatherForecastController.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Threading.Tasks;
5-
#if (!NoAuth)
1+
#if (!NoAuth)
62
using Microsoft.AspNetCore.Authorization;
73
#endif
84
#if (GenerateApi)
9-
using Microsoft.Extensions.Configuration;
105
using Microsoft.Identity.Web;
116
using System.Net;
12-
using System.Net.Http;
137
#endif
148
#if (GenerateGraph)
159
using Microsoft.Graph;
1610
#endif
1711
using Microsoft.AspNetCore.Mvc;
18-
using Microsoft.Extensions.Logging;
1912
#if (OrganizationalAuth || IndividualB2CAuth)
2013
using Microsoft.Identity.Web.Resource;
2114
#endif

src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Data/ApplicationDbContext.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
using ComponentsWebAssembly_CSharp.Server.Models;
2-
using IdentityServer4.EntityFramework.Options;
3-
using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
1+
using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
42
using Microsoft.EntityFrameworkCore;
53
using Microsoft.Extensions.Options;
6-
using System;
7-
using System.Collections.Generic;
8-
using System.Linq;
9-
using System.Threading.Tasks;
4+
using IdentityServer4.EntityFramework.Options;
5+
using ComponentsWebAssembly_CSharp.Server.Models;
106

117
namespace ComponentsWebAssembly_CSharp.Server.Data
128
{

0 commit comments

Comments
 (0)