Skip to content

Commit

Permalink
Reuse the InertEndpointBuilder defined in the ApplicationEndpointFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
mkArtakMSFT committed Jan 30, 2025
1 parent 83fa23e commit e937a99
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System.Linq;
using System.Reflection;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Metadata;
using Microsoft.AspNetCore.Mvc.ActionConstraints;
Expand Down Expand Up @@ -709,12 +708,4 @@ private static void AddRange<T>(IList<T> list, IEnumerable<T> items)
list.Add(item);
}
}

private sealed class InertEndpointBuilder : EndpointBuilder
{
public override Endpoint Build()
{
return new Endpoint(RequestDelegate, new EndpointMetadataCollection(Metadata), DisplayName);
}
}
}
8 changes: 0 additions & 8 deletions src/Mvc/Mvc.Core/src/Routing/ActionEndpointFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -543,12 +543,4 @@ private static RequestDelegate CreateRequestDelegate()
return invoker!.InvokeAsync();
};
}

private sealed class InertEndpointBuilder : EndpointBuilder
{
public override Endpoint Build()
{
return new Endpoint(RequestDelegate, new EndpointMetadataCollection(Metadata), DisplayName);
}
}
}
15 changes: 15 additions & 0 deletions src/Mvc/Mvc.Core/src/Routing/InertEndpointBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;

namespace Microsoft.AspNetCore.Mvc.Routing;

internal sealed class InertEndpointBuilder : EndpointBuilder
{
public override Endpoint Build()
{
return new Endpoint(RequestDelegate, new EndpointMetadataCollection(Metadata), DisplayName);
}
}

0 comments on commit e937a99

Please sign in to comment.