Apply formatting to remaining unformatted files

This commit is contained in:
Neil Brommer 2021-11-22 14:57:51 -08:00
parent 57953fd509
commit c53d7b8ce3
10 changed files with 145 additions and 147 deletions

View file

@ -4,7 +4,7 @@ root = true
insert_final_newline = true
max_line_length = 100
[*.{cs,cshtml,html,xml,js,css,csproj}]
[*.{cs,cshtml,html,xml,js,css,csproj,json}]
indent_style = tab
tab_width = 4
trim_trailing_whitespace = true

View file

@ -6,7 +6,8 @@
@{
var returnUrl = "/";
if (Context.Request.Query.TryGetValue("returnUrl", out var existingUrl)) {
if (Context.Request.Query.TryGetValue("returnUrl", out var existingUrl))
{
returnUrl = existingUrl;
}
}
@ -15,10 +16,14 @@
@if (SignInManager.IsSignedIn(User))
{
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index" title="Manage">Hello @User.Identity?.Name!</a>
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Manage/Index"
title="Manage">
Hello @User.Identity?.Name!
</a>
</li>
<li class="nav-item">
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout" asp-route-returnUrl="/" method="post">
<form class="form-inline" asp-area="Identity" asp-page="/Account/Logout"
asp-route-returnUrl="/" method="post">
<button type="submit" class="nav-link btn btn-link text-dark">Logout</button>
</form>
</li>
@ -26,10 +31,16 @@
else
{
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register" asp-route-returnUrl="@returnUrl">Register</a>
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Register"
asp-route-returnUrl="@returnUrl">
Register
</a>
</li>
<li class="nav-item">
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login" asp-route-returnUrl="@returnUrl">Login</a>
<a class="nav-link text-dark" asp-area="Identity" asp-page="/Account/Login"
asp-route-returnUrl="@returnUrl">
Login
</a>
</li>
}
</ul>

View file

@ -2,14 +2,13 @@ using Microsoft.AspNetCore.ApiAuthorization.IdentityServer;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
namespace Start.Server.Controllers
{
public class OidcConfigurationController : Controller
{
namespace Start.Server.Controllers {
public class OidcConfigurationController : Controller {
private readonly ILogger<OidcConfigurationController> _logger;
public OidcConfigurationController(IClientRequestParametersProvider clientRequestParametersProvider, ILogger<OidcConfigurationController> logger)
{
public OidcConfigurationController(
IClientRequestParametersProvider clientRequestParametersProvider,
ILogger<OidcConfigurationController> logger) {
ClientRequestParametersProvider = clientRequestParametersProvider;
_logger = logger;
}
@ -17,8 +16,7 @@ namespace Start.Server.Controllers
public IClientRequestParametersProvider ClientRequestParametersProvider { get; }
[HttpGet("_configuration/{clientId}")]
public IActionResult GetClientRequestParameters([FromRoute] string clientId)
{
public IActionResult GetClientRequestParameters([FromRoute] string clientId) {
var parameters = ClientRequestParametersProvider.GetClientParameters(HttpContext, clientId);
return Ok(parameters);
}

View file

@ -7,13 +7,11 @@ using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Start.Shared;
namespace Start.Server.Controllers
{
namespace Start.Server.Controllers {
[Authorize]
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
public class WeatherForecastController : ControllerBase {
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
@ -21,17 +19,14 @@ namespace Start.Server.Controllers
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
public WeatherForecastController(ILogger<WeatherForecastController> logger) {
_logger = logger;
}
[HttpGet]
public IEnumerable<WeatherForecast> Get()
{
public IEnumerable<WeatherForecast> Get() {
var rng = new Random();
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast {
Date = DateTime.Now.AddDays(index),
TemperatureC = rng.Next(-20, 55),
Summary = Summaries[rng.Next(Summaries.Length)]

View file

@ -4,10 +4,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Start.Server.Models
{
public class ApplicationUser : IdentityUser
{
namespace Start.Server.Models {
public class ApplicationUser : IdentityUser {
/// <summary>The <see cref="BookmarkContainer"/>s that belong to this user</summary>
public List<BookmarkContainer>? BookmarkContainers { get; set; }
}

View file

@ -7,19 +7,15 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace Start.Server
{
public class Program
{
public static void Main(string[] args)
{
namespace Start.Server {
public class Program {
public static void Main(string[] args) {
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
.ConfigureWebHostDefaults(webBuilder => {
webBuilder.UseStartup<Startup>();
});
}