File tree Expand file tree Collapse file tree 3 files changed +3
-5
lines changed
Examples/JsonApiDotNetCoreExample/Startups Expand file tree Collapse file tree 3 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ public Startup(IConfiguration configuration) : base(configuration)
29
29
public override void ConfigureServices ( IServiceCollection services )
30
30
{
31
31
ConfigureClock ( services ) ;
32
+
32
33
services . AddScoped < SkipCacheQueryStringParameterReader > ( ) ;
33
34
services . AddScoped < IQueryStringParameterReader > ( sp => sp . GetService < SkipCacheQueryStringParameterReader > ( ) ) ;
34
35
Original file line number Diff line number Diff line change @@ -5,6 +5,6 @@ namespace JsonApiDotNetCore.Builders
5
5
{
6
6
internal interface IJsonApiApplicationBuilder
7
7
{
8
- public Action < MvcOptions > ConfigureMvcOptions { get ; set ; }
8
+ public Action < MvcOptions > ConfigureMvcOptions { set ; }
9
9
}
10
10
}
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ public static class ApplicationBuilderExtensions
15
15
/// Registers the JsonApiDotNetCore middleware.
16
16
/// </summary>
17
17
/// <param name="builder">The <see cref="IApplicationBuilder"/> to add the middleware to.</param>
18
- /// <param name="configureMvcOptions">Configure .NET Core MVC options</param>
19
18
/// <example>
20
19
/// The code below is the minimal that is required for proper activation,
21
20
/// which should be added to your Startup.Configure method.
@@ -25,16 +24,14 @@ public static class ApplicationBuilderExtensions
25
24
/// app.UseEndpoints(endpoints => endpoints.MapControllers());
26
25
/// ]]></code>
27
26
/// </example>
28
- public static void UseJsonApi ( this IApplicationBuilder builder , Action < MvcOptions > configureMvcOptions = null )
27
+ public static void UseJsonApi ( this IApplicationBuilder builder )
29
28
{
30
29
var jsonApiApplicationBuilder = builder . ApplicationServices . GetRequiredService < IJsonApiApplicationBuilder > ( ) ;
31
30
jsonApiApplicationBuilder . ConfigureMvcOptions = options =>
32
31
{
33
32
options . InputFormatters . Insert ( 0 , builder . ApplicationServices . GetRequiredService < IJsonApiInputFormatter > ( ) ) ;
34
33
options . OutputFormatters . Insert ( 0 , builder . ApplicationServices . GetRequiredService < IJsonApiOutputFormatter > ( ) ) ;
35
34
options . Conventions . Insert ( 0 , builder . ApplicationServices . GetRequiredService < IJsonApiRoutingConvention > ( ) ) ;
36
-
37
- configureMvcOptions ? . Invoke ( options ) ;
38
35
} ;
39
36
40
37
builder . UseMiddleware < JsonApiMiddleware > ( ) ;
You can’t perform that action at this time.
0 commit comments