Skip to content

Commit e4c1c32

Browse files
Do not emit unused fields in RDG source
Do not emit unused private fields for HTTP verbs that are not used by any of the user-code endpoints. Resolves #48381.
1 parent 6575b28 commit e4c1c32

File tree

40 files changed

+60
-181
lines changed

40 files changed

+60
-181
lines changed

src/Http/Http.Extensions/gen/RequestDelegateGenerator.cs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using System.Collections.Generic;
45
using System.Globalization;
56
using System.IO;
67
using System.Linq;
78
using System.Text;
89
using Microsoft.AspNetCore.Analyzers.Infrastructure;
910
using Microsoft.AspNetCore.App.Analyzers.Infrastructure;
10-
using Microsoft.CodeAnalysis;
11-
using Microsoft.CodeAnalysis.Operations;
12-
using Microsoft.AspNetCore.Http.RequestDelegateGenerator.StaticRouteHandlerModel.Emitters;
1311
using Microsoft.AspNetCore.Http.RequestDelegateGenerator.StaticRouteHandlerModel;
12+
using Microsoft.AspNetCore.Http.RequestDelegateGenerator.StaticRouteHandlerModel.Emitters;
13+
using Microsoft.CodeAnalysis;
1414
using Microsoft.CodeAnalysis.CSharp;
15+
using Microsoft.CodeAnalysis.Operations;
1516

1617
namespace Microsoft.AspNetCore.Http.RequestDelegateGenerator;
1718

@@ -125,7 +126,8 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
125126
.Collect()
126127
.Select((endpoints, _) =>
127128
{
128-
var dedupedByDelegate = endpoints.Distinct<Endpoint>(EndpointDelegateComparer.Instance);
129+
var dedupedByDelegate = endpoints.Distinct(EndpointDelegateComparer.Instance);
130+
var verbs = new HashSet<string>();
129131
using var stringWriter = new StringWriter(CultureInfo.InvariantCulture);
130132
using var codeWriter = new CodeWriter(stringWriter, baseIndent: 2);
131133
foreach (var endpoint in dedupedByDelegate)
@@ -161,15 +163,22 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
161163
{
162164
codeWriter.WriteLine($"{SymbolDisplay.FormatLiteral("{*path:nonfile}", true)},");
163165
}
166+
167+
(var verbSymbol, var verbHttp) = endpoint.EmitVerb();
168+
if (verbHttp is { })
169+
{
170+
verbs.Add(verbHttp);
171+
}
172+
164173
codeWriter.WriteLine("handler,");
165-
codeWriter.WriteLine($"{endpoint.EmitVerb()},");
174+
codeWriter.WriteLine($"{verbSymbol},");
166175
codeWriter.WriteLine("filePath,");
167176
codeWriter.WriteLine("lineNumber);");
168177
codeWriter.Indent--;
169178
codeWriter.EndBlock();
170179
}
171180

172-
return stringWriter.ToString();
181+
return (stringWriter.ToString(), verbs);
173182
});
174183

175184
var endpointHelpers = endpoints
@@ -283,7 +292,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
283292

284293
context.RegisterSourceOutput(thunksAndEndpoints, (context, sources) =>
285294
{
286-
var (((thunks, endpointsCode), helperMethods), helperTypes) = sources;
295+
var (((thunks, (endpointsCode, verbs)), helperMethods), helperTypes) = sources;
287296

288297
if (thunks.IsDefaultOrEmpty || string.IsNullOrEmpty(endpointsCode))
289298
{
@@ -301,7 +310,8 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
301310
thunks: thunksCode.ToString(),
302311
endpoints: endpointsCode,
303312
helperMethods: helperMethods ?? string.Empty,
304-
helperTypes: helperTypes ?? string.Empty);
313+
helperTypes: helperTypes ?? string.Empty,
314+
verbs: verbs);
305315

306316
context.AddSource("GeneratedRouteBuilderExtensions.g.cs", code);
307317
});

src/Http/Http.Extensions/gen/RequestDelegateGeneratorSources.cs

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using System.Collections.Generic;
5+
using System.Text;
46
using Microsoft.CodeAnalysis.CSharp;
7+
58
namespace Microsoft.AspNetCore.Http.RequestDelegateGenerator;
69

710
internal static class RequestDelegateGeneratorSources
@@ -500,7 +503,7 @@ public override bool IsDefined(Type attributeType, bool inherit)
500503
}
501504
""";
502505

503-
public static string GetGeneratedRouteBuilderExtensionsSource(string genericThunks, string thunks, string endpoints, string helperMethods, string helperTypes) => $$"""
506+
public static string GetGeneratedRouteBuilderExtensionsSource(string genericThunks, string thunks, string endpoints, string helperMethods, string helperTypes, HashSet<string> verbs) => $$"""
504507
{{SourceHeader}}
505508
506509
namespace Microsoft.AspNetCore.Builder
@@ -518,7 +521,7 @@ public SourceKey(string path, int line)
518521
}
519522
}
520523
521-
{{GetEndpoints(endpoints)}}
524+
{{GetEndpoints(endpoints, verbs)}}
522525
}
523526
524527
namespace Microsoft.AspNetCore.Http.Generated
@@ -641,7 +644,15 @@ internal static RouteHandlerBuilder MapCore(
641644
}
642645
""" : string.Empty;
643646

644-
private static string GetEndpoints(string endpoints) => endpoints != string.Empty ? $$"""
647+
private static string GetEndpoints(string endpoints, HashSet<string> verbs)
648+
{
649+
if (endpoints == string.Empty)
650+
{
651+
return string.Empty;
652+
}
653+
654+
var builder = new StringBuilder();
655+
builder.Append($$"""
645656
// This class needs to be internal so that the compiled application
646657
// has access to the strongly-typed endpoint definitions that are
647658
// generated by the compiler so that they will be favored by
@@ -650,13 +661,26 @@ private static string GetEndpoints(string endpoints) => endpoints != string.Empt
650661
{{GeneratedCodeAttribute}}
651662
internal static class GenerateRouteBuilderEndpoints
652663
{
653-
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
654-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
655-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
656-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
657-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
658664
665+
""");
666+
667+
foreach (string verb in verbs)
668+
{
669+
builder.AppendLine($$"""
670+
private static readonly string[] {{verb}}Verb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.{{verb}} };
671+
""");
672+
}
673+
674+
if (verbs.Count > 0)
675+
{
676+
builder.AppendLine();
677+
}
678+
679+
builder.Append($$"""
659680
{{endpoints}}
660681
}
661-
""" : string.Empty;
682+
""");
683+
684+
return builder.ToString();
685+
}
662686
}

src/Http/Http.Extensions/gen/StaticRouteHandlerModel/StaticRouteHandlerModel.Emitter.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ public static string EmitSourceKey(this Endpoint endpoint)
3434
return $@"(@""{endpoint.Location.File}"", {endpoint.Location.LineNumber})";
3535
}
3636

37-
public static string EmitVerb(this Endpoint endpoint)
37+
public static (string VerbSymbol, string? VerbHttp) EmitVerb(this Endpoint endpoint)
3838
{
3939
return endpoint.HttpMethod switch
4040
{
41-
"MapGet" => "GetVerb",
42-
"MapPut" => "PutVerb",
43-
"MapPost" => "PostVerb",
44-
"MapDelete" => "DeleteVerb",
45-
"MapPatch" => "PatchVerb",
46-
"MapMethods" => "httpMethods",
47-
"Map" => "null",
48-
"MapFallback" => "null",
41+
"MapGet" => ("GetVerb", "Get"),
42+
"MapPut" => ("PutVerb", "Put"),
43+
"MapPost" => ("PostVerb", "Post"),
44+
"MapDelete" => ("DeleteVerb", "Delete"),
45+
"MapPatch" => ("PatchVerb", "Patch"),
46+
"MapMethods" => ("httpMethods", null),
47+
"Map" => ("null", null),
48+
"MapFallback" => ("null", null),
4949
_ => throw new ArgumentException($"Received unexpected HTTP method: {endpoint.HttpMethod}")
5050
};
5151
}

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_BindAsync_Snapshot.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ExplicitBodyParam_ComplexReturn_Snapshot.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ namespace Microsoft.AspNetCore.Builder
3131
%GENERATEDCODEATTRIBUTE%
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
34-
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
3534
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapPost(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ExplicitHeader_ComplexTypeArrayParam.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ExplicitHeader_NullableStringArrayParam.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ExplicitHeader_StringArrayParam.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ExplicitQuery_ComplexTypeArrayParam.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ExplicitQuery_NullableStringArrayParam.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ExplicitQuery_StringArrayParam.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ExplicitServiceParam_SimpleReturn_Snapshot.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ExplicitSource_SimpleReturn_Snapshot.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ImplicitQuery_ComplexTypeArrayParam.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ImplicitQuery_NullableStringArrayParam.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ImplicitQuery_NullableStringArrayParam_EmptyQueryValues.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

src/Http/Http.Extensions/test/RequestDelegateGenerator/Baselines/MapAction_ImplicitQuery_NullableStringArrayParam_QueryNotPresent.generated.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ namespace Microsoft.AspNetCore.Builder
3232
internal static class GenerateRouteBuilderEndpoints
3333
{
3434
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
35-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
36-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
37-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
38-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
3935

4036
internal static global::Microsoft.AspNetCore.Builder.RouteHandlerBuilder MapGet(
4137
this global::Microsoft.AspNetCore.Routing.IEndpointRouteBuilder endpoints,

0 commit comments

Comments
 (0)