Skip to content

Commit cce1bd7

Browse files
authored
Revert "Remove usings from templates implicitly added by the SDK (#34219)"
This reverts commit d8bba72.
1 parent 9d60f25 commit cce1bd7

File tree

33 files changed

+203
-46
lines changed

33 files changed

+203
-46
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1+
using System;
12
using System.Security.Claims;
3+
using System.Threading;
4+
using System.Threading.Tasks;
25
using Microsoft.AspNetCore.Components;
36
using Microsoft.AspNetCore.Components.Authorization;
47
using Microsoft.AspNetCore.Components.Server;
58
using Microsoft.AspNetCore.Identity;
9+
using Microsoft.Extensions.DependencyInjection;
10+
using Microsoft.Extensions.Logging;
611
using Microsoft.Extensions.Options;
712

813
namespace BlazorServerWeb_CSharp.Areas.Identity

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
25
using Microsoft.EntityFrameworkCore;
36

47
namespace BlazorServerWeb_CSharp.Data

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

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System;
2+
13
namespace BlazorServerWeb_CSharp.Data
24
{
35
public class WeatherForecast

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

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
using System;
2+
using System.Linq;
3+
using System.Threading.Tasks;
4+
15
namespace BlazorServerWeb_CSharp.Data
26
{
37
public class WeatherForecastService

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
using System.Diagnostics;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.Linq;
5+
using System.Threading.Tasks;
26
using Microsoft.AspNetCore.Mvc;
37
using Microsoft.AspNetCore.Mvc.RazorPages;
8+
using Microsoft.Extensions.Logging;
49

510
namespace BlazorServerWeb_CSharp.Pages
611
{

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

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
15
#if (OrganizationalAuth || IndividualB2CAuth)
26
using Microsoft.AspNetCore.Authentication;
37
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
@@ -10,18 +14,23 @@
1014
#endif
1115
using Microsoft.AspNetCore.Authorization;
1216
#endif
17+
using Microsoft.AspNetCore.Builder;
1318
using Microsoft.AspNetCore.Components;
1419
#if (IndividualLocalAuth)
1520
using Microsoft.AspNetCore.Components.Authorization;
1621
using Microsoft.AspNetCore.Identity;
1722
using Microsoft.AspNetCore.Identity.UI;
1823
#endif
24+
using Microsoft.AspNetCore.Hosting;
1925
#if (OrganizationalAuth)
2026
using Microsoft.AspNetCore.Mvc.Authorization;
2127
#endif
2228
#if (IndividualLocalAuth)
2329
using Microsoft.EntityFrameworkCore;
2430
#endif
31+
using Microsoft.Extensions.Configuration;
32+
using Microsoft.Extensions.DependencyInjection;
33+
using Microsoft.Extensions.Hosting;
2534
#if (GenerateGraph)
2635
using Graph = Microsoft.Graph;
2736
#endif

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

+8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Net.Http;
4+
using System.Text;
5+
using System.Threading.Tasks;
16
#if (!NoAuth && Hosted)
27
using Microsoft.AspNetCore.Components.WebAssembly.Authentication;
38
#endif
49
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
10+
using Microsoft.Extensions.Configuration;
11+
using Microsoft.Extensions.DependencyInjection;
12+
using Microsoft.Extensions.Logging;
513
#if (Hosted)
614
using ComponentsWebAssembly_CSharp.Client;
715
#else

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

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
22
using Microsoft.AspNetCore.Mvc;
3+
using Microsoft.Extensions.Logging;
34

45
namespace ComponentsWebAssembly_CSharp.Server.Controllers
56
{

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
#if (!NoAuth)
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
#if (!NoAuth)
26
using Microsoft.AspNetCore.Authorization;
37
#endif
48
#if (GenerateApi)
9+
using Microsoft.Extensions.Configuration;
510
using Microsoft.Identity.Web;
611
using System.Net;
12+
using System.Net.Http;
713
#endif
814
#if (GenerateGraph)
915
using Microsoft.Graph;
1016
#endif
1117
using Microsoft.AspNetCore.Mvc;
18+
using Microsoft.Extensions.Logging;
1219
#if (OrganizationalAuth || IndividualB2CAuth)
1320
using Microsoft.Identity.Web.Resource;
1421
#endif

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

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
1+
using ComponentsWebAssembly_CSharp.Server.Models;
2+
using IdentityServer4.EntityFramework.Options;
3+
using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
24
using Microsoft.EntityFrameworkCore;
35
using Microsoft.Extensions.Options;
4-
using IdentityServer4.EntityFramework.Options;
5-
using ComponentsWebAssembly_CSharp.Server.Models;
6+
using System;
7+
using System.Collections.Generic;
8+
using System.Linq;
9+
using System.Threading.Tasks;
610

711
namespace ComponentsWebAssembly_CSharp.Server.Data
812
{

src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Server/Models/ApplicationUser.cs

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
using Microsoft.AspNetCore.Identity;
2+
using System;
3+
using System.Collections.Generic;
4+
using System.Linq;
5+
using System.Threading.Tasks;
26

37
namespace ComponentsWebAssembly_CSharp.Server.Models
48
{

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
using System.Diagnostics;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.Linq;
5+
using System.Threading.Tasks;
26
using Microsoft.AspNetCore.Mvc;
37
using Microsoft.AspNetCore.Mvc.RazorPages;
8+
using Microsoft.Extensions.Logging;
49

510
namespace ComponentsWebAssembly_CSharp.Server.Pages
611
{

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
1-
#if (OrganizationalAuth || IndividualB2CAuth || IndividualLocalAuth)
1+
using System.Linq;
2+
#if (OrganizationalAuth || IndividualB2CAuth || IndividualLocalAuth)
23
using Microsoft.AspNetCore.Authentication;
34
#endif
45
#if (OrganizationalAuth || IndividualB2CAuth)
56
using Microsoft.AspNetCore.Authentication.JwtBearer;
67
#endif
8+
using Microsoft.AspNetCore.Builder;
9+
using Microsoft.AspNetCore.Hosting;
710
using Microsoft.AspNetCore.ResponseCompression;
811
#if (IndividualLocalAuth)
912
using Microsoft.EntityFrameworkCore;
1013
#endif
14+
using Microsoft.Extensions.Configuration;
15+
using Microsoft.Extensions.DependencyInjection;
16+
using Microsoft.Extensions.Hosting;
1117
#if (GenerateGraph)
1218
using Graph = Microsoft.Graph;
1319
#endif

src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Shared/WeatherForecast.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
namespace ComponentsWebAssembly_CSharp.Shared
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace ComponentsWebAssembly_CSharp.Shared
26
{
37
public class WeatherForecast
48
{

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

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
using System;
2+
using Microsoft.AspNetCore.Builder;
3+
using Microsoft.Extensions.Hosting;
4+
15
var builder = WebApplication.CreateBuilder(args);
26
var app = builder.Build();
37

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

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Threading.Tasks;
6+
using Microsoft.AspNetCore.Builder;
7+
using Microsoft.AspNetCore.Hosting;
8+
using Microsoft.Extensions.DependencyInjection;
9+
using Microsoft.Extensions.Hosting;
110
using GrpcService_CSharp.Services;
211

312
var builder = WebApplication.CreateBuilder(args);

src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/Services/GreeterService.cs

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
15
using Grpc.Core;
6+
using Microsoft.Extensions.Logging;
27
using GrpcService_CSharp;
38

49
namespace GrpcService_CSharp.Services

src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/Areas/MyFeature/Pages/Page1.cshtml.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
using Microsoft.AspNetCore.Mvc;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
26
using Microsoft.AspNetCore.Mvc.RazorPages;
37

48
namespace Company.RazorClassLibrary1.MyFeature.Pages

src/ProjectTemplates/Web.ProjectTemplates/content/RazorClassLibrary-CSharp/ExampleJsInterop.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System;
2+
using System.Threading.Tasks;
13
using Microsoft.JSInterop;
24

35
namespace Company.RazorClassLibrary1

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
25
using Microsoft.EntityFrameworkCore;
36

47
namespace Company.WebApplication1.Data

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

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
using System;
2+
using System.Collections.Generic;
13
using System.Diagnostics;
4+
using System.Linq;
5+
using System.Threading.Tasks;
26
using Microsoft.AspNetCore.Mvc;
37
using Microsoft.AspNetCore.Mvc.RazorPages;
8+
using Microsoft.Extensions.Logging;
49

510
namespace Company.WebApplication1.Pages
611
{

src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Index.cshtml.cs

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
1-
#if (GenerateApiOrGraph)
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
#if (GenerateApiOrGraph)
6+
using Microsoft.Extensions.Configuration;
7+
using Microsoft.Identity.Web;
28
using System.Net;
9+
using System.Net.Http;
310
#endif
4-
using Microsoft.AspNetCore.Mvc;
5-
using Microsoft.AspNetCore.Mvc.RazorPages;
611
#if (GenerateGraph)
712
using Microsoft.Graph;
813
#endif
9-
#if (GenerateApiOrGraph)
10-
using Microsoft.Identity.Web;
11-
#endif
14+
using Microsoft.AspNetCore.Mvc;
15+
using Microsoft.AspNetCore.Mvc.RazorPages;
16+
using Microsoft.Extensions.Logging;
1217

1318
namespace Company.WebApplication1.Pages
1419
{

src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Privacy.cshtml.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
using Microsoft.AspNetCore.Mvc;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Mvc;
26
using Microsoft.AspNetCore.Mvc.RazorPages;
7+
using Microsoft.Extensions.Logging;
38

49
namespace Company.WebApplication1.Pages
510
{

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

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
15
#if (OrganizationalAuth || IndividualB2CAuth)
26
using Microsoft.AspNetCore.Authentication;
7+
using Microsoft.Identity.Web;
8+
using Microsoft.Identity.Web.UI;
39
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
410
using Microsoft.AspNetCore.Authorization;
511
#endif
12+
using Microsoft.AspNetCore.Builder;
13+
using Microsoft.AspNetCore.Hosting;
614
#if (IndividualLocalAuth)
715
using Microsoft.AspNetCore.Identity;
816
#endif
@@ -12,10 +20,10 @@
1220
#if (IndividualLocalAuth)
1321
using Microsoft.EntityFrameworkCore;
1422
#endif
15-
#if (OrganizationalAuth || IndividualB2CAuth)
16-
using Microsoft.Identity.Web;
17-
using Microsoft.Identity.Web.UI;
18-
#endif
23+
using Microsoft.Extensions.Configuration;
24+
using Microsoft.Extensions.DependencyInjection;
25+
using Microsoft.Extensions.Hosting;
26+
using Microsoft.Extensions.Logging;
1927
#if (MultiOrgAuth)
2028
using Microsoft.IdentityModel.Tokens;
2129
#endif

src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Controllers/HomeController.cs

+13-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
using System.Diagnostics;
2-
#if (GenerateApiOrGraph)
3-
using System.Net;
4-
#endif
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Diagnostics;
4+
using System.Linq;
5+
using System.Threading.Tasks;
56
#if (OrganizationalAuth)
67
using Microsoft.AspNetCore.Authorization;
78
#endif
8-
using Microsoft.AspNetCore.Mvc;
9-
#if (GenerateGraph)
10-
using Microsoft.Graph;
11-
#endif
129
#if (GenerateApiOrGraph)
10+
using Microsoft.Extensions.Configuration;
1311
using Microsoft.Identity.Web;
12+
using System.Net;
13+
using System.Net.Http;
14+
#endif
15+
#if (GenerateGraph)
16+
using Microsoft.Graph;
1417
#endif
18+
using Microsoft.AspNetCore.Mvc;
19+
using Microsoft.Extensions.Logging;
1520
using Company.WebApplication1.Models;
1621

1722
namespace Company.WebApplication1.Controllers

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
25
using Microsoft.EntityFrameworkCore;
36

47
namespace Company.WebApplication1.Data

src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Models/ErrorViewModel.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using System;
2+
13
namespace Company.WebApplication1.Models
24
{
35
public class ErrorViewModel

0 commit comments

Comments
 (0)