File tree 1 file changed +6
-1
lines changed
src/JsonApiDotNetCore/Extensions
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ public static class IApplicationBuilderExtensions
18
18
/// Adds necessary components such as routing to your application
19
19
/// </summary>
20
20
/// <param name="app"></param>
21
+ /// <param name="AddUserMiddleware"></param>
21
22
/// <returns></returns>
22
- public static void UseJsonApi ( this IApplicationBuilder app )
23
+ public static void UseJsonApi ( this IApplicationBuilder app , Action < IApplicationBuilder > AddUserMiddleware = null )
23
24
{
24
25
LogResourceGraphValidations ( app ) ;
25
26
using ( var scope = app . ApplicationServices . CreateScope ( ) )
@@ -31,6 +32,10 @@ public static void UseJsonApi(this IApplicationBuilder app)
31
32
// An endpoint is selected and set on the HttpContext if a match is found
32
33
app . UseRouting ( ) ;
33
34
35
+ // user defined middleware to run after routing occurs.
36
+ if ( AddUserMiddleware != null )
37
+ AddUserMiddleware ( app ) ;
38
+
34
39
// middleware to run after routing occurs.
35
40
app . UseMiddleware < CurrentRequestMiddleware > ( ) ;
36
41
You can’t perform that action at this time.
0 commit comments