Skip to content

Commit 049e784

Browse files
committed
style: Apply minor formatting adjustments and reorder a using statement for consistency.
1 parent 4791b9b commit 049e784

3 files changed

Lines changed: 8 additions & 9 deletions

File tree

src/ApiService/BookStore.ApiService/Endpoints/BookEndpoints.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Globalization;
22
using BookStore.ApiService.Aggregates;
33
using BookStore.ApiService.Infrastructure;
4+
using BookStore.ApiService.Models;
45
using BookStore.ApiService.Projections;
56
using BookStore.Shared.Models;
67
using Marten;
@@ -10,8 +11,6 @@
1011
using Microsoft.Extensions.Options;
1112
using Npgsql;
1213

13-
using BookStore.ApiService.Models;
14-
1514
namespace BookStore.ApiService.Endpoints;
1615

1716
public static class BookEndpoints

src/ApiService/BookStore.ApiService/Infrastructure/LoggingEnricher.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ public async Task InvokeAsync(HttpContext context)
2121
{
2222
// Cache Activity reference to avoid multiple property accesses
2323
var activity = Activity.Current;
24-
24+
2525
// Get headers once to avoid multiple lookups
2626
var headers = context.Request.Headers;
27-
27+
2828
// Get correlation ID (already set by MartenMetadataMiddleware)
2929
var correlationId = headers.TryGetValue("X-Correlation-ID", out var correlationHeader)
3030
? correlationHeader.ToString()
@@ -46,8 +46,8 @@ public async Task InvokeAsync(HttpContext context)
4646
var request = context.Request;
4747
var requestPath = request.Path.Value;
4848
var requestMethod = request.Method;
49-
var userAgent = headers.TryGetValue("User-Agent", out var userAgentHeader)
50-
? userAgentHeader.ToString()
49+
var userAgent = headers.TryGetValue("User-Agent", out var userAgentHeader)
50+
? userAgentHeader.ToString()
5151
: null;
5252
var remoteIp = context.Connection.RemoteIpAddress?.ToString();
5353

src/ApiService/BookStore.ApiService/Program.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ static async Task WaitForProjectionsAsync(IDocumentStore store, ILogger logger)
8585
{
8686
var logger = context.RequestServices.GetRequiredService<ILogger<Program>>();
8787
var exception = exceptionHandlerFeature.Error;
88-
88+
8989
logger.LogError(exception, "Unhandled exception: {Message}", exception.Message);
90-
90+
9191
context.Response.StatusCode = StatusCodes.Status500InternalServerError;
9292
context.Response.ContentType = "application/problem+json";
93-
93+
9494
await context.Response.WriteAsJsonAsync(new
9595
{
9696
type = "https://tools.ietf.org/html/rfc9110#section-15.6.1",

0 commit comments

Comments
 (0)