Skip to content

Commit e937a99

Browse files
committed
Reuse the InertEndpointBuilder defined in the ApplicationEndpointFactory
1 parent 83fa23e commit e937a99

File tree

3 files changed

+15
-17
lines changed

3 files changed

+15
-17
lines changed

src/Mvc/Mvc.Core/src/ApplicationModels/DefaultApplicationModelProvider.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
using System.Linq;
55
using System.Reflection;
6-
using Microsoft.AspNetCore.Builder;
76
using Microsoft.AspNetCore.Http;
87
using Microsoft.AspNetCore.Http.Metadata;
98
using Microsoft.AspNetCore.Mvc.ActionConstraints;
@@ -709,12 +708,4 @@ private static void AddRange<T>(IList<T> list, IEnumerable<T> items)
709708
list.Add(item);
710709
}
711710
}
712-
713-
private sealed class InertEndpointBuilder : EndpointBuilder
714-
{
715-
public override Endpoint Build()
716-
{
717-
return new Endpoint(RequestDelegate, new EndpointMetadataCollection(Metadata), DisplayName);
718-
}
719-
}
720711
}

src/Mvc/Mvc.Core/src/Routing/ActionEndpointFactory.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -543,12 +543,4 @@ private static RequestDelegate CreateRequestDelegate()
543543
return invoker!.InvokeAsync();
544544
};
545545
}
546-
547-
private sealed class InertEndpointBuilder : EndpointBuilder
548-
{
549-
public override Endpoint Build()
550-
{
551-
return new Endpoint(RequestDelegate, new EndpointMetadataCollection(Metadata), DisplayName);
552-
}
553-
}
554546
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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 Microsoft.AspNetCore.Builder;
5+
using Microsoft.AspNetCore.Http;
6+
7+
namespace Microsoft.AspNetCore.Mvc.Routing;
8+
9+
internal sealed class InertEndpointBuilder : EndpointBuilder
10+
{
11+
public override Endpoint Build()
12+
{
13+
return new Endpoint(RequestDelegate, new EndpointMetadataCollection(Metadata), DisplayName);
14+
}
15+
}

0 commit comments

Comments
 (0)