Closed KevinDockx closed 3 years ago
RoutingMarkerService is internal - cannot use this to check. Consider ASP.NET Core feature request.
Feature request: https://github.com/dotnet/aspnetcore/issues/37679
As per Javier's answer on the feature request: for now, use the alternative and check if we can resolve a publicly exposed type, like EndpointDataSource.
In the future, consider an analyzer.
Answer isn't sufficient: checking the registered type only checks whether a service is registered on a container, NOT the order in which middleware is added to the request pipeline...
Check whether the call into UseHttpCacheHeaders is situated between UseRouting and UseEndpoints - allows for throwing a nice Exception to inform users of this.
Cfr: https://github.com/dotnet/aspnetcore/blob/main/src/Http/Routing/src/Builder/EndpointRoutingApplicationBuilderExtensions.cs#L135