Get rid of pubternal in routing
The only pubternal that remains is DfaGraphWriter - it's a good use case for pubternal because it's something we want to expose, but we'd never service and would willingly break the API in the future. It's also really unlikly that anyone would build on top of it.
This commit is contained in:
parent
c96f179898
commit
1c126ab773
|
|
@ -497,34 +497,6 @@ namespace Microsoft.AspNetCore.Routing.Internal
|
|||
public DfaGraphWriter(System.IServiceProvider services) { }
|
||||
public void Write(Microsoft.AspNetCore.Routing.EndpointDataSource dataSource, System.IO.TextWriter writer) { }
|
||||
}
|
||||
[System.ObsoleteAttribute("This type will be marked as internal in a future release.")]
|
||||
public enum SegmentState
|
||||
{
|
||||
Beginning = 0,
|
||||
Inside = 1,
|
||||
}
|
||||
[System.Diagnostics.DebuggerDisplayAttribute("{DebuggerToString(),nq}")]
|
||||
[System.ObsoleteAttribute("This type will be marked as internal in a future release.")]
|
||||
public partial class UriBuildingContext
|
||||
{
|
||||
public UriBuildingContext(System.Text.Encodings.Web.UrlEncoder urlEncoder) { }
|
||||
public bool AppendTrailingSlash { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public Microsoft.AspNetCore.Routing.Internal.SegmentState BufferState { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
public bool LowercaseQueryStrings { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public bool LowercaseUrls { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
|
||||
public System.IO.TextWriter PathWriter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
public System.IO.TextWriter QueryWriter { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
public Microsoft.AspNetCore.Routing.Internal.SegmentState UriState { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
public bool Accept(string value) { throw null; }
|
||||
public bool Accept(string value, bool encodeSlashes) { throw null; }
|
||||
public bool Buffer(string value) { throw null; }
|
||||
public void Clear() { }
|
||||
public void EndSegment() { }
|
||||
public void Remove(string literal) { }
|
||||
public Microsoft.AspNetCore.Http.PathString ToPathString() { throw null; }
|
||||
public Microsoft.AspNetCore.Http.QueryString ToQueryString() { throw null; }
|
||||
public override string ToString() { throw null; }
|
||||
}
|
||||
}
|
||||
namespace Microsoft.AspNetCore.Routing.Matching
|
||||
{
|
||||
|
|
@ -767,10 +739,7 @@ namespace Microsoft.AspNetCore.Routing.Template
|
|||
}
|
||||
public partial class TemplateBinder
|
||||
{
|
||||
[System.ObsoleteAttribute("This constructor is obsolete and will be marked internal in a future release. Use the TemplateBinderFactory service to create TemplateBinder instances.")]
|
||||
public TemplateBinder(System.Text.Encodings.Web.UrlEncoder urlEncoder, Microsoft.Extensions.ObjectPool.ObjectPool<Microsoft.AspNetCore.Routing.Internal.UriBuildingContext> pool, Microsoft.AspNetCore.Routing.Patterns.RoutePattern pattern, Microsoft.AspNetCore.Routing.RouteValueDictionary defaults, System.Collections.Generic.IEnumerable<string> requiredKeys, System.Collections.Generic.IEnumerable<System.ValueTuple<string, Microsoft.AspNetCore.Routing.IParameterPolicy>> parameterPolicies) { }
|
||||
[System.ObsoleteAttribute("This constructor is obsolete and will be marked internal in a furture release. Use the TemplateBinderFactory service to create TemplateBinder instances.")]
|
||||
public TemplateBinder(System.Text.Encodings.Web.UrlEncoder urlEncoder, Microsoft.Extensions.ObjectPool.ObjectPool<Microsoft.AspNetCore.Routing.Internal.UriBuildingContext> pool, Microsoft.AspNetCore.Routing.Template.RouteTemplate template, Microsoft.AspNetCore.Routing.RouteValueDictionary defaults) { }
|
||||
internal TemplateBinder() { }
|
||||
public string BindValues(Microsoft.AspNetCore.Routing.RouteValueDictionary acceptedValues) { throw null; }
|
||||
public Microsoft.AspNetCore.Routing.Template.TemplateValuesResult GetValues(Microsoft.AspNetCore.Routing.RouteValueDictionary ambientValues, Microsoft.AspNetCore.Routing.RouteValueDictionary values) { throw null; }
|
||||
public static bool RoutePartsEqual(object a, object b) { throw null; }
|
||||
|
|
@ -868,8 +837,7 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
}
|
||||
public partial class TreeRouteBuilder
|
||||
{
|
||||
[System.ObsoleteAttribute("This constructor will be marked internal in a future release. Use the service provider to create instances of TreeRouteBuilder.")]
|
||||
public TreeRouteBuilder(Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, Microsoft.Extensions.ObjectPool.ObjectPool<Microsoft.AspNetCore.Routing.Internal.UriBuildingContext> objectPool, Microsoft.AspNetCore.Routing.IInlineConstraintResolver constraintResolver) { }
|
||||
internal TreeRouteBuilder() { }
|
||||
public System.Collections.Generic.IList<Microsoft.AspNetCore.Routing.Tree.InboundRouteEntry> InboundEntries { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
public System.Collections.Generic.IList<Microsoft.AspNetCore.Routing.Tree.OutboundRouteEntry> OutboundEntries { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
public Microsoft.AspNetCore.Routing.Tree.TreeRouter Build() { throw null; }
|
||||
|
|
@ -880,9 +848,8 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
}
|
||||
public partial class TreeRouter : Microsoft.AspNetCore.Routing.IRouter
|
||||
{
|
||||
internal TreeRouter() { }
|
||||
public static readonly string RouteGroupKey;
|
||||
[System.ObsoleteAttribute("This constructor will be marked obsolete in a future release. Use the TreeRouterBuilder to create instances of TreeRouter.")]
|
||||
public TreeRouter(Microsoft.AspNetCore.Routing.Tree.UrlMatchingTree[] trees, System.Collections.Generic.IEnumerable<Microsoft.AspNetCore.Routing.Tree.OutboundRouteEntry> linkGenerationEntries, System.Text.Encodings.Web.UrlEncoder urlEncoder, Microsoft.Extensions.ObjectPool.ObjectPool<Microsoft.AspNetCore.Routing.Internal.UriBuildingContext> objectPool, Microsoft.Extensions.Logging.ILogger routeLogger, Microsoft.Extensions.Logging.ILogger constraintLogger, int version) { }
|
||||
public int Version { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||
public Microsoft.AspNetCore.Routing.VirtualPathData GetVirtualPath(Microsoft.AspNetCore.Routing.VirtualPathContext context) { throw null; }
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute]
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Routing;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Microsoft.AspNetCore.Builder
|
||||
|
|
@ -75,4 +74,4 @@ namespace Microsoft.AspNetCore.Builder
|
|||
return builder.UseRouter(routeBuilder.Build());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ using System.Text.Encodings.Web;
|
|||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.Extensions;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Template;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Routing.Constraints;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Patterns;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
|
||||
services.TryAddTransient<IInlineConstraintResolver, DefaultInlineConstraintResolver>();
|
||||
services.TryAddTransient<ObjectPoolProvider, DefaultObjectPoolProvider>();
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
services.TryAddSingleton<ObjectPool<UriBuildingContext>>(s =>
|
||||
{
|
||||
var provider = s.GetRequiredService<ObjectPoolProvider>();
|
||||
|
|
@ -51,7 +50,6 @@ namespace Microsoft.Extensions.DependencyInjection
|
|||
var constraintResolver = s.GetRequiredService<IInlineConstraintResolver>();
|
||||
return new TreeRouteBuilder(loggerFactory, objectPool, constraintResolver);
|
||||
}));
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
services.TryAddSingleton(typeof(RoutingMarkerService));
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing.Patterns
|
||||
{
|
||||
|
|
@ -256,4 +255,4 @@ namespace Microsoft.AspNetCore.Routing.Patterns
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Patterns;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
|
||||
|
|
|
|||
|
|
@ -245,7 +245,6 @@ namespace Microsoft.AspNetCore.Routing
|
|||
}
|
||||
}
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
private void EnsureBinder(HttpContext context)
|
||||
{
|
||||
if (_binder == null)
|
||||
|
|
@ -254,7 +253,6 @@ namespace Microsoft.AspNetCore.Routing
|
|||
_binder = binderFactory.Create(ParsedTemplate, Defaults);
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
private void EnsureLoggers(HttpContext context)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing
|
||||
|
|
@ -58,4 +57,4 @@ namespace Microsoft.AspNetCore.Routing
|
|||
return routeCollection;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Routing.Constraints;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Template;
|
||||
using Microsoft.AspNetCore.Routing.Tree;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing.Internal
|
||||
namespace Microsoft.AspNetCore.Routing
|
||||
{
|
||||
// Segments are treated as all-or-none. We should never output a partial segment.
|
||||
// If we add any subsegment of this segment to the generated URI, we have to add
|
||||
|
|
@ -11,8 +9,7 @@ namespace Microsoft.AspNetCore.Routing.Internal
|
|||
// used a value for {p1}, we have to output the entire segment up to the next "/".
|
||||
// Otherwise we could end up with the partial segment "v1" instead of the entire
|
||||
// segment "v1-v2.xml".
|
||||
[Obsolete("This type will be marked as internal in a future release.")]
|
||||
public enum SegmentState
|
||||
internal enum SegmentState
|
||||
{
|
||||
Beginning,
|
||||
Inside,
|
||||
|
|
@ -4,7 +4,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text.Encodings.Web;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Patterns;
|
||||
using Microsoft.Extensions.ObjectPool;
|
||||
|
||||
|
|
@ -13,15 +12,11 @@ namespace Microsoft.AspNetCore.Routing.Template
|
|||
internal sealed class DefaultTemplateBinderFactory : TemplateBinderFactory
|
||||
{
|
||||
private readonly ParameterPolicyFactory _policyFactory;
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
private readonly ObjectPool<UriBuildingContext> _pool;
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
public DefaultTemplateBinderFactory(
|
||||
ParameterPolicyFactory policyFactory,
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
ObjectPool<UriBuildingContext> pool)
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
{
|
||||
if (policyFactory == null)
|
||||
{
|
||||
|
|
@ -50,9 +45,7 @@ namespace Microsoft.AspNetCore.Routing.Template
|
|||
throw new ArgumentNullException(nameof(defaults));
|
||||
}
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
return new TemplateBinder(UrlEncoder.Default, _pool, template, defaults);
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
}
|
||||
|
||||
public override TemplateBinder Create(RoutePattern pattern)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ using System.Linq;
|
|||
using System.Runtime.CompilerServices;
|
||||
using System.Text.Encodings.Web;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Patterns;
|
||||
using Microsoft.Extensions.ObjectPool;
|
||||
|
||||
|
|
@ -19,9 +18,7 @@ namespace Microsoft.AspNetCore.Routing.Template
|
|||
public class TemplateBinder
|
||||
{
|
||||
private readonly UrlEncoder _urlEncoder;
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
private readonly ObjectPool<UriBuildingContext> _pool;
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
private readonly (string parameterName, IRouteConstraint constraint)[] _constraints;
|
||||
private readonly RouteValueDictionary _defaults;
|
||||
|
|
@ -42,14 +39,9 @@ namespace Microsoft.AspNetCore.Routing.Template
|
|||
/// <param name="pool">The <see cref="ObjectPool{T}"/>.</param>
|
||||
/// <param name="template">The <see cref="RouteTemplate"/> to bind values to.</param>
|
||||
/// <param name="defaults">The default values for <paramref name="template"/>.</param>
|
||||
[Obsolete(
|
||||
"This constructor is obsolete and will be marked internal in a furture release. Use the TemplateBinderFactory service " +
|
||||
"to create TemplateBinder instances.")]
|
||||
public TemplateBinder(
|
||||
internal TemplateBinder(
|
||||
UrlEncoder urlEncoder,
|
||||
#pragma warning disable PUB0001
|
||||
ObjectPool<UriBuildingContext> pool,
|
||||
#pragma warning restore PUB0001
|
||||
RouteTemplate template,
|
||||
RouteValueDictionary defaults)
|
||||
: this(urlEncoder, pool, template?.ToRoutePattern(), defaults, requiredKeys: null, parameterPolicies: null)
|
||||
|
|
@ -67,14 +59,9 @@ namespace Microsoft.AspNetCore.Routing.Template
|
|||
/// <param name="parameterPolicies">
|
||||
/// A list of (<see cref="string"/>, <see cref="IParameterPolicy"/>) pairs to evalute when producing a URI.
|
||||
/// </param>
|
||||
[Obsolete(
|
||||
"This constructor is obsolete and will be marked internal in a future release. Use the TemplateBinderFactory service " +
|
||||
"to create TemplateBinder instances.")]
|
||||
public TemplateBinder(
|
||||
internal TemplateBinder(
|
||||
UrlEncoder urlEncoder,
|
||||
#pragma warning disable PUB0001
|
||||
ObjectPool<UriBuildingContext> pool,
|
||||
#pragma warning restore PUB0001
|
||||
RoutePattern pattern,
|
||||
RouteValueDictionary defaults,
|
||||
IEnumerable<string> requiredKeys,
|
||||
|
|
@ -124,9 +111,7 @@ namespace Microsoft.AspNetCore.Routing.Template
|
|||
|
||||
internal TemplateBinder(
|
||||
UrlEncoder urlEncoder,
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
ObjectPool<UriBuildingContext> pool,
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
RoutePattern pattern,
|
||||
IEnumerable<(string parameterName, IParameterPolicy policy)> parameterPolicies)
|
||||
{
|
||||
|
|
@ -506,7 +491,6 @@ namespace Microsoft.AspNetCore.Routing.Template
|
|||
}
|
||||
}
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
private bool TryBindValuesCore(UriBuildingContext context, RouteValueDictionary acceptedValues)
|
||||
{
|
||||
// If we have any output parameter transformers, allow them a chance to influence the parameter values
|
||||
|
|
@ -647,7 +631,6 @@ namespace Microsoft.AspNetCore.Routing.Template
|
|||
}
|
||||
return false;
|
||||
}
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
/// <summary>
|
||||
/// Compares two objects for equality as parts of a case-insensitive path.
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing.Tree
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Encodings.Web;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Template;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.ObjectPool;
|
||||
|
|
@ -20,9 +19,7 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
private readonly ILogger _logger;
|
||||
private readonly ILogger _constraintLogger;
|
||||
private readonly UrlEncoder _urlEncoder;
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
private readonly ObjectPool<UriBuildingContext> _objectPool;
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
private readonly IInlineConstraintResolver _constraintResolver;
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -31,12 +28,9 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
/// <param name="loggerFactory">The <see cref="ILoggerFactory"/>.</param>
|
||||
/// <param name="objectPool">The <see cref="ObjectPool{UrlBuildingContext}"/>.</param>
|
||||
/// <param name="constraintResolver">The <see cref="IInlineConstraintResolver"/>.</param>
|
||||
[Obsolete("This constructor will be marked internal in a future release. Use the service provider to create instances of TreeRouteBuilder.")]
|
||||
public TreeRouteBuilder(
|
||||
internal TreeRouteBuilder(
|
||||
ILoggerFactory loggerFactory,
|
||||
#pragma warning disable CS0618, PUB0001 // Type or member is obsolete
|
||||
ObjectPool<UriBuildingContext> objectPool,
|
||||
#pragma warning restore CS0618, PUB0001 // Type or member is obsolete
|
||||
IInlineConstraintResolver constraintResolver)
|
||||
{
|
||||
if (loggerFactory == null)
|
||||
|
|
@ -244,7 +238,6 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
tree.AddEntry(entry);
|
||||
}
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
return new TreeRouter(
|
||||
trees.Values.OrderBy(tree => tree.Order).ToArray(),
|
||||
OutboundEntries,
|
||||
|
|
@ -253,7 +246,6 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
_logger,
|
||||
_constraintLogger,
|
||||
version);
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Logging;
|
||||
using Microsoft.AspNetCore.Routing.Template;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
|
@ -40,14 +39,11 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
/// <param name="constraintLogger">The <see cref="ILogger"/> instance used
|
||||
/// in <see cref="RouteConstraintMatcher"/>.</param>
|
||||
/// <param name="version">The version of this route.</param>
|
||||
[Obsolete("This constructor will be marked obsolete in a future release. Use the TreeRouterBuilder to create instances of TreeRouter.")]
|
||||
public TreeRouter(
|
||||
internal TreeRouter(
|
||||
UrlMatchingTree[] trees,
|
||||
IEnumerable<OutboundRouteEntry> linkGenerationEntries,
|
||||
UrlEncoder urlEncoder,
|
||||
#pragma warning disable CS0618, PUB0001 // Type or member is obsolete
|
||||
ObjectPool<UriBuildingContext> objectPool,
|
||||
#pragma warning restore CS0618, PUB0001 // Type or member is obsolete
|
||||
ILogger routeLogger,
|
||||
ILogger constraintLogger,
|
||||
int version)
|
||||
|
|
|
|||
|
|
@ -2,12 +2,10 @@
|
|||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Text.Encodings.Web;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.Extensions.ObjectPool;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing
|
||||
{
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
internal class UriBuilderContextPooledObjectPolicy : IPooledObjectPolicy<UriBuildingContext>
|
||||
{
|
||||
public UriBuildingContext Create()
|
||||
|
|
@ -21,5 +19,4 @@ namespace Microsoft.AspNetCore.Routing
|
|||
return true;
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
|
@ -9,11 +8,10 @@ using System.Text;
|
|||
using System.Text.Encodings.Web;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing.Internal
|
||||
namespace Microsoft.AspNetCore.Routing
|
||||
{
|
||||
[Obsolete("This type will be marked as internal in a future release.")]
|
||||
[DebuggerDisplay("{DebuggerToString(),nq}")]
|
||||
public class UriBuildingContext
|
||||
internal class UriBuildingContext
|
||||
{
|
||||
// Holds the 'accepted' parts of the path.
|
||||
private readonly StringBuilder _path;
|
||||
|
|
@ -6,7 +6,6 @@ using System.IO;
|
|||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing.Patterns;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing.Internal
|
||||
|
|
|
|||
|
|
@ -3,12 +3,9 @@
|
|||
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Template;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.Extensions.ObjectPool;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ using System.Linq;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.Features;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Template;
|
||||
using Microsoft.AspNetCore.Routing.TestObjects;
|
||||
using Microsoft.AspNetCore.Routing.Tree;
|
||||
|
|
@ -33,12 +32,10 @@ namespace Microsoft.AspNetCore.Routing.Matching
|
|||
|
||||
public override Matcher Build()
|
||||
{
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
var builder = new TreeRouteBuilder(
|
||||
NullLoggerFactory.Instance,
|
||||
new DefaultObjectPool<UriBuildingContext>(new UriBuilderContextPooledObjectPolicy()),
|
||||
new DefaultInlineConstraintResolver(Options.Create(new RouteOptions()), new TestServiceProvider()));
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
var selector = new DefaultEndpointSelector();
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Http;
|
|||
using Microsoft.Extensions.Primitives;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing.Internal
|
||||
namespace Microsoft.AspNetCore.Routing
|
||||
{
|
||||
public class PathTokenizerTest
|
||||
{
|
||||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
|
|
|||
|
|
@ -8,13 +8,11 @@ using System.Threading.Tasks;
|
|||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing.Constraints;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.TestObjects;
|
||||
using Microsoft.AspNetCore.Testing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.Extensions.ObjectPool;
|
||||
using Microsoft.Extensions.Options;
|
||||
using Microsoft.Extensions.WebEncoders.Testing;
|
||||
using Moq;
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Patterns;
|
||||
using Microsoft.AspNetCore.Routing.TestObjects;
|
||||
using Microsoft.AspNetCore.Routing.Tree;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text.Encodings.Web;
|
||||
using Microsoft.AspNetCore.Routing.Constraints;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Patterns;
|
||||
using Microsoft.AspNetCore.Routing.TestObjects;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
@ -16,7 +15,6 @@ using Xunit;
|
|||
|
||||
namespace Microsoft.AspNetCore.Routing.Template.Tests
|
||||
{
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
public class TemplateBinderTests
|
||||
{
|
||||
private readonly IInlineConstraintResolver _inlineConstraintResolver = GetInlineConstraintResolver();
|
||||
|
|
@ -1481,5 +1479,4 @@ namespace Microsoft.AspNetCore.Routing.Template.Tests
|
|||
public Dictionary<string, string> Parameters { get; private set; }
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Testing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
|
|
|||
|
|
@ -7,10 +7,9 @@ using System.Linq;
|
|||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing.Patterns;
|
||||
using Microsoft.AspNetCore.Routing.Template;
|
||||
using Microsoft.AspNetCore.Routing.Tree;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing.Internal.Routing
|
||||
namespace Microsoft.AspNetCore.Routing.Tree
|
||||
{
|
||||
public class LinkGenerationDecisionTreeTest
|
||||
{
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||
|
||||
using System.Text.Encodings.Web;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Template;
|
||||
using Microsoft.AspNetCore.Testing;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
@ -248,12 +246,10 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
var objectPool = objectPoolProvider.Create(objectPolicy);
|
||||
|
||||
var constraintResolver = GetInlineConstraintResolver();
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
var builder = new TreeRouteBuilder(
|
||||
NullLoggerFactory.Instance,
|
||||
objectPool,
|
||||
constraintResolver);
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,8 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Encodings.Web;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Routing.Internal;
|
||||
using Microsoft.AspNetCore.Routing.Template;
|
||||
using Microsoft.AspNetCore.Routing.TestObjects;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
|
@ -23,10 +21,8 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
{
|
||||
private static readonly RequestDelegate NullHandler = (c) => Task.CompletedTask;
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
private static ObjectPool<UriBuildingContext> Pool = new DefaultObjectPoolProvider().Create(
|
||||
new UriBuilderContextPooledObjectPolicy());
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
[Theory]
|
||||
[InlineData("template/5", "template/{parameter:int}")]
|
||||
|
|
@ -2075,7 +2071,6 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
return new DefaultInlineConstraintResolver(optionsMock.Object, new TestServiceProvider());
|
||||
}
|
||||
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
private static TreeRouteBuilder CreateBuilder()
|
||||
{
|
||||
var objectPoolProvider = new DefaultObjectPoolProvider();
|
||||
|
|
@ -2089,7 +2084,6 @@ namespace Microsoft.AspNetCore.Routing.Tree
|
|||
constraintResolver);
|
||||
return builder;
|
||||
}
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
private static TreeRouter CreateTreeRouter(
|
||||
string firstTemplate,
|
||||
|
|
|
|||
|
|
@ -4,9 +4,8 @@
|
|||
using Microsoft.Extensions.WebEncoders.Testing;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.AspNetCore.Routing.Internal
|
||||
namespace Microsoft.AspNetCore.Routing
|
||||
{
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
public class UriBuildingContextTest
|
||||
{
|
||||
[Fact]
|
||||
|
|
@ -98,5 +97,4 @@ namespace Microsoft.AspNetCore.Routing.Internal
|
|||
Assert.Equal(expected, uriBuilldingContext.ToPathString().Value);
|
||||
}
|
||||
}
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
}
|
||||
Loading…
Reference in New Issue