Skip to content

Commit 427163d

Browse files
Do not emit unused fields in RDG source (#48426)
* 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. * Move verbs to incremental pipeline Use another incremental pipeline to produce the HTTP verbs. * Add custom comparer Add custom comparer for endpoints by their HTTP method.
1 parent b930c67 commit 427163d

File tree

42 files changed

+88
-181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+88
-181
lines changed

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

Lines changed: 25 additions & 7 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.Immutable;
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

@@ -122,7 +123,7 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
122123
.Collect()
123124
.Select((endpoints, _) =>
124125
{
125-
var dedupedByDelegate = endpoints.Distinct<Endpoint>(EndpointDelegateComparer.Instance);
126+
var dedupedByDelegate = endpoints.Distinct(EndpointDelegateComparer.Instance);
126127
using var stringWriter = new StringWriter(CultureInfo.InvariantCulture);
127128
using var codeWriter = new CodeWriter(stringWriter, baseIndent: 2);
128129
foreach (var endpoint in dedupedByDelegate)
@@ -169,6 +170,17 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
169170
return stringWriter.ToString();
170171
});
171172

173+
var httpVerbs = endpoints
174+
.Collect()
175+
.Select((endpoints, _) =>
176+
{
177+
return endpoints
178+
.Distinct(EndpointHttpMethodComparer.Instance)
179+
.Select(endpoint => endpoint.EmitterContext.HttpMethod!)
180+
.Where(verb => verb is not null)
181+
.ToImmutableHashSet();
182+
});
183+
172184
var endpointHelpers = endpoints
173185
.Collect()
174186
.Select((endpoints, _) =>
@@ -260,11 +272,16 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
260272
return stringWriter.ToString();
261273
});
262274

263-
var thunksAndEndpoints = thunks.Collect().Combine(stronglyTypedEndpointDefinitions).Combine(endpointHelpers).Combine(helperTypes);
275+
var thunksAndEndpoints = thunks
276+
.Collect()
277+
.Combine(stronglyTypedEndpointDefinitions)
278+
.Combine(httpVerbs)
279+
.Combine(endpointHelpers)
280+
.Combine(helperTypes);
264281

265282
context.RegisterSourceOutput(thunksAndEndpoints, (context, sources) =>
266283
{
267-
var (((thunks, endpointsCode), helperMethods), helperTypes) = sources;
284+
var ((((thunks, endpointsCode), httpVerbs), helperMethods), helperTypes) = sources;
268285

269286
if (thunks.IsDefaultOrEmpty || string.IsNullOrEmpty(endpointsCode))
270287
{
@@ -282,7 +299,8 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
282299
thunks: thunksCode.ToString(),
283300
endpoints: endpointsCode,
284301
helperMethods: helperMethods ?? string.Empty,
285-
helperTypes: helperTypes ?? string.Empty);
302+
helperTypes: helperTypes ?? string.Empty,
303+
verbs: httpVerbs);
286304

287305
context.AddSource("GeneratedRouteBuilderExtensions.g.cs", code);
288306
});

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

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
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.Immutable;
5+
using System.Linq;
6+
using System.Text;
47
using Microsoft.CodeAnalysis.CSharp;
58
namespace Microsoft.AspNetCore.Http.RequestDelegateGenerator;
69

@@ -436,7 +439,7 @@ public override bool IsDefined(Type attributeType, bool inherit)
436439
}
437440
""";
438441

439-
public static string GetGeneratedRouteBuilderExtensionsSource(string genericThunks, string thunks, string endpoints, string helperMethods, string helperTypes) => $$"""
442+
public static string GetGeneratedRouteBuilderExtensionsSource(string genericThunks, string thunks, string endpoints, string helperMethods, string helperTypes, ImmutableHashSet<string> verbs) => $$"""
440443
{{SourceHeader}}
441444
442445
namespace Microsoft.AspNetCore.Builder
@@ -454,7 +457,7 @@ public SourceKey(string path, int line)
454457
}
455458
}
456459
457-
{{GetEndpoints(endpoints)}}
460+
{{GetEndpoints(endpoints, verbs)}}
458461
}
459462
460463
namespace Microsoft.AspNetCore.Http.Generated
@@ -595,7 +598,15 @@ internal static RouteHandlerBuilder MapCore(
595598
}
596599
""" : string.Empty;
597600

598-
private static string GetEndpoints(string endpoints) => endpoints != string.Empty ? $$"""
601+
private static string GetEndpoints(string endpoints, ImmutableHashSet<string> verbs)
602+
{
603+
if (endpoints == string.Empty)
604+
{
605+
return string.Empty;
606+
}
607+
608+
var builder = new StringBuilder();
609+
builder.Append($$"""
599610
// This class needs to be internal so that the compiled application
600611
// has access to the strongly-typed endpoint definitions that are
601612
// generated by the compiler so that they will be favored by
@@ -604,13 +615,26 @@ private static string GetEndpoints(string endpoints) => endpoints != string.Empt
604615
{{GeneratedCodeAttribute}}
605616
internal static class GenerateRouteBuilderEndpoints
606617
{
607-
private static readonly string[] GetVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Get };
608-
private static readonly string[] PostVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Post };
609-
private static readonly string[] PutVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Put };
610-
private static readonly string[] DeleteVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Delete };
611-
private static readonly string[] PatchVerb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.Patch };
612618
619+
""");
620+
621+
foreach (string verb in verbs.OrderBy(p => p, System.StringComparer.Ordinal))
622+
{
623+
builder.AppendLine($$"""
624+
private static readonly string[] {{verb}}Verb = new[] { global::Microsoft.AspNetCore.Http.HttpMethods.{{verb}} };
625+
""");
626+
}
627+
628+
if (verbs.Count > 0)
629+
{
630+
builder.AppendLine();
631+
}
632+
633+
builder.Append($$"""
613634
{{endpoints}}
614635
}
615-
""" : string.Empty;
636+
""");
637+
638+
return builder.ToString();
639+
}
616640
}

src/Http/Http.Extensions/gen/StaticRouteHandlerModel/Emitters/EmitterContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ internal sealed class EmitterContext
1616
public bool HasEndpointMetadataProvider { get; set; }
1717
public bool HasEndpointParameterMetadataProvider { get; set; }
1818
public bool HasResponseMetadata { get; set; }
19+
public string? HttpMethod { get; set; }
1920
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
using System;
5+
using System.Collections.Generic;
6+
7+
namespace Microsoft.AspNetCore.Http.RequestDelegateGenerator.StaticRouteHandlerModel;
8+
9+
internal sealed class EndpointHttpMethodComparer : IEqualityComparer<Endpoint>
10+
{
11+
public static readonly EndpointHttpMethodComparer Instance = new();
12+
private static readonly IEqualityComparer<string> OrdinalComparer = StringComparer.Ordinal;
13+
14+
public bool Equals(Endpoint x, Endpoint y) => OrdinalComparer.Equals(x.HttpMethod, y.HttpMethod);
15+
16+
public int GetHashCode(Endpoint obj) => OrdinalComparer.GetHashCode(obj.HttpMethod);
17+
}

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,20 @@ public static string EmitSourceKey(this Endpoint endpoint)
3636

3737
public static string EmitVerb(this Endpoint endpoint)
3838
{
39-
return endpoint.HttpMethod switch
40-
{
41-
"MapGet" => "GetVerb",
42-
"MapPut" => "PutVerb",
43-
"MapPost" => "PostVerb",
44-
"MapDelete" => "DeleteVerb",
45-
"MapPatch" => "PatchVerb",
46-
"MapMethods" => "httpMethods",
47-
"Map" => "null",
48-
"MapFallback" => "null",
39+
(var verbSymbol, endpoint.EmitterContext.HttpMethod) = endpoint.HttpMethod switch
40+
{
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
};
51+
52+
return verbSymbol;
5153
}
5254

5355
/*

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,

0 commit comments

Comments
 (0)