-
Notifications
You must be signed in to change notification settings - Fork 10k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update templates to use file-scoped namespace declarations
Contributes to #33947
- Loading branch information
1 parent
1395fa8
commit b54efa8
Showing
24 changed files
with
497 additions
and
519 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
...emplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/ApplicationDbContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
namespace BlazorServerWeb_CSharp.Data | ||
namespace BlazorServerWeb_CSharp.Data; | ||
|
||
public class ApplicationDbContext : IdentityDbContext | ||
{ | ||
public class ApplicationDbContext : IdentityDbContext | ||
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) | ||
: base(options) | ||
{ | ||
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) | ||
: base(options) | ||
{ | ||
} | ||
} | ||
} |
15 changes: 7 additions & 8 deletions
15
...jectTemplates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecast.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
namespace BlazorServerWeb_CSharp.Data | ||
namespace BlazorServerWeb_CSharp.Data; | ||
|
||
public class WeatherForecast | ||
{ | ||
public class WeatherForecast | ||
{ | ||
public DateTime Date { get; set; } | ||
public DateTime Date { get; set; } | ||
|
||
public int TemperatureC { get; set; } | ||
public int TemperatureC { get; set; } | ||
|
||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | ||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); | ||
|
||
public string? Summary { get; set; } | ||
} | ||
public string? Summary { get; set; } | ||
} |
27 changes: 13 additions & 14 deletions
27
...plates/Web.ProjectTemplates/content/BlazorServerWeb-CSharp/Data/WeatherForecastService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
namespace BlazorServerWeb_CSharp.Data | ||
namespace BlazorServerWeb_CSharp.Data; | ||
|
||
public class WeatherForecastService | ||
{ | ||
public class WeatherForecastService | ||
private static readonly string[] Summaries = new[] | ||
{ | ||
private static readonly string[] Summaries = new[] | ||
{ | ||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | ||
}; | ||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" | ||
}; | ||
|
||
public Task<WeatherForecast[]> GetForecastAsync(DateTime startDate) | ||
public Task<WeatherForecast[]> GetForecastAsync(DateTime startDate) | ||
{ | ||
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast | ||
{ | ||
return Task.FromResult(Enumerable.Range(1, 5).Select(index => new WeatherForecast | ||
{ | ||
Date = startDate.AddDays(index), | ||
TemperatureC = Random.Shared.Next(-20, 55), | ||
Summary = Summaries[Random.Shared.Next(Summaries.Length)] | ||
}).ToArray()); | ||
} | ||
Date = startDate.AddDays(index), | ||
TemperatureC = Random.Shared.Next(-20, 55), | ||
Summary = Summaries[Random.Shared.Next(Summaries.Length)] | ||
}).ToArray()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 15 additions & 16 deletions
31
...es/content/ComponentsWebAssembly-CSharp/Server/Controllers/OidcConfigurationController.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
using Microsoft.AspNetCore.ApiAuthorization.IdentityServer; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace ComponentsWebAssembly_CSharp.Server.Controllers | ||
namespace ComponentsWebAssembly_CSharp.Server.Controllers; | ||
|
||
public class OidcConfigurationController : Controller | ||
{ | ||
public class OidcConfigurationController : Controller | ||
{ | ||
private readonly ILogger<OidcConfigurationController> _logger; | ||
private readonly ILogger<OidcConfigurationController> _logger; | ||
|
||
public OidcConfigurationController(IClientRequestParametersProvider clientRequestParametersProvider, ILogger<OidcConfigurationController> logger) | ||
{ | ||
ClientRequestParametersProvider = clientRequestParametersProvider; | ||
_logger = logger; | ||
} | ||
public OidcConfigurationController(IClientRequestParametersProvider clientRequestParametersProvider, ILogger<OidcConfigurationController> logger) | ||
{ | ||
ClientRequestParametersProvider = clientRequestParametersProvider; | ||
_logger = logger; | ||
} | ||
|
||
public IClientRequestParametersProvider ClientRequestParametersProvider { get; } | ||
public IClientRequestParametersProvider ClientRequestParametersProvider { get; } | ||
|
||
[HttpGet("_configuration/{clientId}")] | ||
public IActionResult GetClientRequestParameters([FromRoute]string clientId) | ||
{ | ||
var parameters = ClientRequestParametersProvider.GetClientParameters(HttpContext, clientId); | ||
return Ok(parameters); | ||
} | ||
[HttpGet("_configuration/{clientId}")] | ||
public IActionResult GetClientRequestParameters([FromRoute]string clientId) | ||
{ | ||
var parameters = ClientRequestParametersProvider.GetClientParameters(HttpContext, clientId); | ||
return Ok(parameters); | ||
} | ||
} |
Oops, something went wrong.