Skip to content

Commit

Permalink
refactors
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinkramer committed Dec 29, 2024
1 parent 014cf6c commit 477e537
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion BankApi.Core/Defaults/Builder.Auth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public static partial class ApiBuilder
{
public static IServiceCollection AddAuthServices(this IServiceCollection services)
{
var apiKeyEvents = new ApiKeyEvents
ApiKeyEvents apiKeyEvents = new()
{
OnValidateKey = context =>
{
Expand Down
2 changes: 1 addition & 1 deletion BankApi.Core/Defaults/Builder.DownstreamApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public static IServiceCollection AddDownstreamApiServices(this IServiceCollectio

return services;
}
}
}
2 changes: 1 addition & 1 deletion BankApi.Core/Implementation/Operation.Teller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static async Task<Results<Ok<Teller>, NotFound, UnprocessableEntity>> Get
var release = await client.Repos["dotnet"]["runtime"].Releases.Latest.GetAsync(cancellationToken: cancellationToken);

return release?.Author?.HtmlUrl is string authorGitHubUrl
? TypedResults.Ok(new Teller() { GitHubProfile = new Uri(authorGitHubUrl) })
? TypedResults.Ok(new Teller() { GitHubProfile = new (authorGitHubUrl) })
: TypedResults.NotFound();
}

Expand Down
2 changes: 1 addition & 1 deletion BankApi.Service.Beta/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
var app = builder.Build();

app.UseExceptionHandler();
app.UsePathBase(new PathString($"/{GlobalConfiguration.ApiDocument.Info.Version}")); // Useful when versioning routing happens in an API Management system
app.UsePathBase(new ($"/{GlobalConfiguration.ApiDocument.Info.Version}")); // Useful when versioning routing happens in an API Management system
app.UseAuthorization(); // explicitly register because we use path base
app.UseRateLimiter();
app.UseCors();
Expand Down
2 changes: 1 addition & 1 deletion BankApi.Service.Stable/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
var app = builder.Build();

app.UseExceptionHandler();
app.UsePathBase(new PathString($"/{GlobalConfiguration.ApiDocument.Info.Version}")); // Useful when versioning routing happens in an API Management system
app.UsePathBase(new ($"/{GlobalConfiguration.ApiDocument.Info.Version}")); // Useful when versioning routing happens in an API Management system
app.UseAuthorization(); // explicitly register because we use path base
app.UseRateLimiter();
app.UseCors();
Expand Down
2 changes: 1 addition & 1 deletion BankApi.Tests/MockDb.Bank.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ public BankDb CreateDbContext()
.UseInMemoryDatabase(GlobalConfiguration.ApiSettings!.DatabaseName)
.Options;

return new BankDb(options);
return new (options);
}
}
4 changes: 2 additions & 2 deletions BankApi.Tests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public static Task CreateContext()
[Test]
public async Task CreateBankReturnsCreated()
{
var response = await BankOperation.CreateBank(new BankModel()
var response = await BankOperation.CreateBank(new ()
{
BankTier = BankTier.A,
Id = Guid.Parse(bankId),
Expand All @@ -32,7 +32,7 @@ public async Task CreateBankReturnsCreated()
[Test, DependsOn(nameof(CreateBankReturnsCreated))]
public async Task UpdateBankReturnsNoContent()
{
var response = await BankOperation.UpdateBank(Guid.Parse(bankId), new BankModel()
var response = await BankOperation.UpdateBank(Guid.Parse(bankId), new ()
{
BankTier = BankTier.A,
Id = Guid.Parse(bankId),
Expand Down

0 comments on commit 477e537

Please sign in to comment.