Skip to content

Commit b109ee4

Browse files
author
Bart Koelman
committed
Renamed CurrentRequestMiddleware to JsonApiMiddleware
1 parent 6cb4cc2 commit b109ee4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/JsonApiDotNetCore/Extensions/ApplicationBuilderExtensions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static class ApplicationBuilderExtensions
2222
/// <code>
2323
/// app.UseJsonApi(skipRegisterMiddleware: true);
2424
/// app.UseRouting();
25-
/// app.UseMiddleware{CurrentRequestMiddleware}();
25+
/// app.UseMiddleware{JsonApiMiddleware}();
2626
/// app.UseEndpoints(endpoints => endpoints.MapControllers());
2727
/// </code>
2828
/// </example>
@@ -50,7 +50,7 @@ public static void UseJsonApi(this IApplicationBuilder app, bool skipRegisterMid
5050
}
5151

5252
// middleware to run after routing occurs.
53-
app.UseMiddleware<CurrentRequestMiddleware>();
53+
app.UseMiddleware<JsonApiMiddleware>();
5454

5555
// Executes the endpoints that was selected by routing.
5656
app.UseEndpoints(endpoints => endpoints.MapControllers());

src/JsonApiDotNetCore/Middleware/CurrentRequestMiddleware.cs renamed to src/JsonApiDotNetCore/Middleware/JsonApiMiddleware.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ namespace JsonApiDotNetCore.Middleware
2020
/// <summary>
2121
/// Intercepts HTTP requests to populate injected <see cref="ICurrentRequest"/> instance for json:api requests.
2222
/// </summary>
23-
public sealed class CurrentRequestMiddleware
23+
public sealed class JsonApiMiddleware
2424
{
2525
private readonly RequestDelegate _next;
2626

27-
public CurrentRequestMiddleware(RequestDelegate next)
27+
public JsonApiMiddleware(RequestDelegate next)
2828
{
2929
_next = next;
3030
}

test/UnitTests/Middleware/CurrentRequestMiddlewareTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public async Task ParseUrlBase_UrlHasNegativeBaseIdAndTypeIsInt_ShouldNotThrowJA
7373

7474
private sealed class InvokeConfiguration
7575
{
76-
public CurrentRequestMiddleware MiddleWare;
76+
public JsonApiMiddleware MiddleWare;
7777
public HttpContext HttpContext;
7878
public Mock<IControllerResourceMapping> ControllerResourceMapping;
7979
public Mock<IJsonApiOptions> Options;
@@ -95,7 +95,7 @@ private InvokeConfiguration GetConfiguration(string path, string resourceName =
9595
{
9696
throw new ArgumentException("Path should start with a '/'");
9797
}
98-
var middleware = new CurrentRequestMiddleware(httpContext =>
98+
var middleware = new JsonApiMiddleware(httpContext =>
9999
{
100100
return Task.Run(() => Console.WriteLine("finished"));
101101
});

0 commit comments

Comments
 (0)