File tree Expand file tree Collapse file tree
samples/PartialResponse.AspNetCore.Mvc.Formatters.Json.Samples Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33using Microsoft . AspNetCore . Builder ;
44using Microsoft . AspNetCore . Hosting ;
5+ using Microsoft . AspNetCore . Mvc . Formatters ;
56using Microsoft . Extensions . Configuration ;
67using Microsoft . Extensions . DependencyInjection ;
78using Microsoft . Extensions . Logging ;
@@ -20,10 +21,10 @@ public Startup(IConfiguration configuration)
2021
2122 public void ConfigureServices ( IServiceCollection services )
2223 {
23- services . Configure < MvcPartialJsonOptions > ( this . configuration . GetSection ( "PartialJson" ) ) ;
24+ services . Configure < MvcPartialJsonOptions > ( options => options . IgnoreCase = true ) ;
2425
2526 services
26- . AddMvc ( options => options . OutputFormatters . Clear ( ) )
27+ . AddMvc ( options => options . OutputFormatters . RemoveType < JsonOutputFormatter > ( ) )
2728 . AddPartialJsonFormatters ( ) ;
2829 }
2930
Original file line number Diff line number Diff line change 66 "System" : " Information" ,
77 "Microsoft" : " Information"
88 }
9- },
10- "PartialJson" : {
11- "IgnoreCase" : true
129 }
1310}
You can’t perform that action at this time.
0 commit comments