Make types in Microsoft.AspNetCore.Mvc.Internal namespace internal

This commit is contained in:
Pranav K 2018-10-24 12:44:11 -07:00
parent 9f1a222d90
commit 8d66f104f7
335 changed files with 483 additions and 750 deletions

View File

@ -5,10 +5,10 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.ActionConstraints;
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.Template; using Microsoft.AspNetCore.Routing.Template;

View File

@ -7,12 +7,11 @@ using System.Diagnostics;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.ActionConstraints;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.ActionConstraints
{ {
public class ActionConstraintCache internal class ActionConstraintCache
{ {
private readonly IActionDescriptorCollectionProvider _collectionProvider; private readonly IActionDescriptorCollectionProvider _collectionProvider;
private readonly IActionConstraintProvider[] _actionConstraintProviders; private readonly IActionConstraintProvider[] _actionConstraintProviders;

View File

@ -2,9 +2,8 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using Microsoft.AspNetCore.Mvc.ActionConstraints;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.ActionConstraints
{ {
/// <summary> /// <summary>
/// A default implementation of <see cref="IActionConstraintProvider"/>. /// A default implementation of <see cref="IActionConstraintProvider"/>.
@ -14,7 +13,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// <see cref="IActionConstraintMetadata"/> implements <see cref="IActionConstraint"/> or /// <see cref="IActionConstraintMetadata"/> implements <see cref="IActionConstraint"/> or
/// <see cref="IActionConstraintFactory"/>/ /// <see cref="IActionConstraintFactory"/>/
/// </remarks> /// </remarks>
public class DefaultActionConstraintProvider : IActionConstraintProvider internal class DefaultActionConstraintProvider : IActionConstraintProvider
{ {
/// <inheritdoc /> /// <inheritdoc />
public int Order => -1000; public int Order => -1000;
@ -61,4 +60,4 @@ namespace Microsoft.AspNetCore.Mvc.Internal
} }
} }
} }
} }

View File

@ -4,12 +4,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using Microsoft.AspNetCore.Mvc.ActionConstraints;
using Microsoft.Extensions.Primitives;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.ActionConstraints
{ {
public class HttpMethodActionConstraint : IActionConstraint internal class HttpMethodActionConstraint : IActionConstraint
{ {
public static readonly int HttpMethodConstraintOrder = 100; public static readonly int HttpMethodConstraintOrder = 100;

View File

@ -1,15 +1,13 @@
// 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Mvc.ActionConstraints; namespace Microsoft.AspNetCore.Mvc.ActionConstraints
namespace Microsoft.AspNetCore.Mvc.Internal
{ {
/// <summary> /// <summary>
/// An <see cref="IActionConstraint"/> constraint that identifies a type which can be used to select an action /// An <see cref="IActionConstraint"/> constraint that identifies a type which can be used to select an action
/// based on incoming request. /// based on incoming request.
/// </summary> /// </summary>
public interface IConsumesActionConstraint : IActionConstraint internal interface IConsumesActionConstraint : IActionConstraint
{ {
} }
} }

View File

@ -1,13 +1,13 @@
// 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc
{ {
/// <summary> /// <summary>
/// Represents data used to build an <c>ApiDescription</c>, stored as part of the /// Represents data used to build an <c>ApiDescription</c>, stored as part of the
/// <see cref="Abstractions.ActionDescriptor.Properties"/>. /// <see cref="Abstractions.ActionDescriptor.Properties"/>.
/// </summary> /// </summary>
public class ApiDescriptionActionData internal class ApiDescriptionActionData
{ {
/// <summary> /// <summary>
/// The <c>ApiDescription.GroupName</c> of <c>ApiDescription</c> objects for the associated /// The <c>ApiDescription.GroupName</c> of <c>ApiDescription</c> objects for the associated
@ -15,4 +15,4 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// </summary> /// </summary>
public string GroupName { get; set; } public string GroupName { get; set; }
} }
} }

View File

@ -3,11 +3,10 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Mvc.ApplicationModels;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.ApplicationModels
{ {
public static class ActionAttributeRouteModel internal static class ActionAttributeRouteModel
{ {
public static IEnumerable<(AttributeRouteModel route, SelectorModel actionSelector, SelectorModel controllerSelector)> GetAttributeRoutes(ActionModel actionModel) public static IEnumerable<(AttributeRouteModel route, SelectorModel actionSelector, SelectorModel controllerSelector)> GetAttributeRoutes(ActionModel actionModel)
{ {

View File

@ -7,7 +7,6 @@ using System.Linq;
using System.Reflection; using System.Reflection;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;

View File

@ -4,14 +4,13 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Mvc.ApplicationModels;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.ApplicationModels
{ {
/// <summary> /// <summary>
/// Applies conventions to a <see cref="ApplicationModel"/>. /// Applies conventions to a <see cref="ApplicationModel"/>.
/// </summary> /// </summary>
public static class ApplicationModelConventions internal static class ApplicationModelConventions
{ {
/// <summary> /// <summary>
/// Applies conventions to a <see cref="ApplicationModel"/>. /// Applies conventions to a <see cref="ApplicationModel"/>.

View File

@ -5,12 +5,11 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc.ApplicationModels;
using Microsoft.AspNetCore.Mvc.Authorization; using Microsoft.AspNetCore.Mvc.Authorization;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.ApplicationModels
{ {
public class AuthorizationApplicationModelProvider : IApplicationModelProvider internal class AuthorizationApplicationModelProvider : IApplicationModelProvider
{ {
private readonly IAuthorizationPolicyProvider _policyProvider; private readonly IAuthorizationPolicyProvider _policyProvider;

View File

@ -3,7 +3,7 @@
using System; using System;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Mvc.Internal; using Microsoft.AspNetCore.Mvc.ActionConstraints;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace Microsoft.AspNetCore.Mvc.ApplicationModels namespace Microsoft.AspNetCore.Mvc.ApplicationModels

View File

@ -8,19 +8,18 @@ using System.Linq;
using System.Reflection; using System.Reflection;
using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.ActionConstraints; using Microsoft.AspNetCore.Mvc.ActionConstraints;
using Microsoft.AspNetCore.Mvc.ApplicationModels;
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.Routing; using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing;
using Resources = Microsoft.AspNetCore.Mvc.Core.Resources; using Resources = Microsoft.AspNetCore.Mvc.Core.Resources;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.ApplicationModels
{ {
/// <summary> /// <summary>
/// Creates instances of <see cref="ControllerActionDescriptor"/> from <see cref="ApplicationModel"/>. /// Creates instances of <see cref="ControllerActionDescriptor"/> from <see cref="ApplicationModel"/>.
/// </summary> /// </summary>
public static class ControllerActionDescriptorBuilder internal static class ControllerActionDescriptorBuilder
{ {
// This is the default order for attribute routes whose order calculated from // This is the default order for attribute routes whose order calculated from
// the controller model is null. // the controller model is null.
@ -634,4 +633,4 @@ namespace Microsoft.AspNetCore.Mvc.Internal
} }
} }
} }
} }

View File

@ -6,14 +6,13 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.ApplicationModels;
using Microsoft.AspNetCore.Mvc.ApplicationParts; using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.ApplicationModels
{ {
public class ControllerActionDescriptorProvider : IActionDescriptorProvider internal class ControllerActionDescriptorProvider : IActionDescriptorProvider
{ {
private readonly ApplicationPartManager _partManager; private readonly ApplicationPartManager _partManager;
private readonly IApplicationModelProvider[] _applicationModelProviders; private readonly IApplicationModelProvider[] _applicationModelProviders;
@ -63,7 +62,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// <inheritdoc /> /// <inheritdoc />
public void OnProvidersExecuted(ActionDescriptorProviderContext context) public void OnProvidersExecuted(ActionDescriptorProviderContext context)
{ {
// After all of the providers have run, we need to provide a 'null' for each all of route values that // After all of the providers have run, we need to provide a 'null' for each all of route values that
// participate in action selection. // participate in action selection.
// //
// This is important for scenarios like Razor Pages, that use the 'page' route value. An action that // This is important for scenarios like Razor Pages, that use the 'page' route value. An action that
@ -95,14 +94,14 @@ namespace Microsoft.AspNetCore.Mvc.Internal
} }
} }
protected internal IEnumerable<ControllerActionDescriptor> GetDescriptors() internal IEnumerable<ControllerActionDescriptor> GetDescriptors()
{ {
var applicationModel = BuildModel(); var applicationModel = BuildModel();
ApplicationModelConventions.ApplyConventions(applicationModel, _conventions); ApplicationModelConventions.ApplyConventions(applicationModel, _conventions);
return ControllerActionDescriptorBuilder.Build(applicationModel); return ControllerActionDescriptorBuilder.Build(applicationModel);
} }
protected internal ApplicationModel BuildModel() internal ApplicationModel BuildModel()
{ {
var controllerTypes = GetControllerTypes(); var controllerTypes = GetControllerTypes();
var context = new ApplicationModelProviderContext(controllerTypes); var context = new ApplicationModelProviderContext(controllerTypes);

View File

@ -7,7 +7,6 @@ using System.Linq;
using System.Reflection; using System.Reflection;
using Microsoft.AspNetCore.Mvc.ActionConstraints; using Microsoft.AspNetCore.Mvc.ActionConstraints;
using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.ApplicationModels;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.Routing; using Microsoft.AspNetCore.Mvc.Routing;
@ -15,9 +14,9 @@ using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Internal; using Microsoft.Extensions.Internal;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.ApplicationModels
{ {
public class DefaultApplicationModelProvider : IApplicationModelProvider internal class DefaultApplicationModelProvider : IApplicationModelProvider
{ {
private readonly MvcOptions _mvcOptions; private readonly MvcOptions _mvcOptions;
private readonly IModelMetadataProvider _modelMetadataProvider; private readonly IModelMetadataProvider _modelMetadataProvider;
@ -39,7 +38,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
public int Order => -1000; public int Order => -1000;
/// <inheritdoc /> /// <inheritdoc />
public virtual void OnProvidersExecuting(ApplicationModelProviderContext context) public void OnProvidersExecuting(ApplicationModelProviderContext context)
{ {
if (context == null) if (context == null)
{ {
@ -98,7 +97,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
} }
/// <inheritdoc /> /// <inheritdoc />
public virtual void OnProvidersExecuted(ApplicationModelProviderContext context) public void OnProvidersExecuted(ApplicationModelProviderContext context)
{ {
// Intentionally empty. // Intentionally empty.
} }
@ -108,7 +107,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// </summary> /// </summary>
/// <param name="typeInfo">The <see cref="TypeInfo"/>.</param> /// <param name="typeInfo">The <see cref="TypeInfo"/>.</param>
/// <returns>A <see cref="ControllerModel"/> for the given <see cref="TypeInfo"/>.</returns> /// <returns>A <see cref="ControllerModel"/> for the given <see cref="TypeInfo"/>.</returns>
protected virtual ControllerModel CreateControllerModel(TypeInfo typeInfo) internal ControllerModel CreateControllerModel(TypeInfo typeInfo)
{ {
if (typeInfo == null) if (typeInfo == null)
{ {
@ -215,7 +214,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// </summary> /// </summary>
/// <param name="propertyInfo">The <see cref="PropertyInfo"/>.</param> /// <param name="propertyInfo">The <see cref="PropertyInfo"/>.</param>
/// <returns>A <see cref="PropertyModel"/> for the given <see cref="PropertyInfo"/>.</returns> /// <returns>A <see cref="PropertyModel"/> for the given <see cref="PropertyInfo"/>.</returns>
protected virtual PropertyModel CreatePropertyModel(PropertyInfo propertyInfo) internal PropertyModel CreatePropertyModel(PropertyInfo propertyInfo)
{ {
if (propertyInfo == null) if (propertyInfo == null)
{ {
@ -263,7 +262,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// An <see cref="ActionModel"/> instance for the given action <see cref="MethodInfo"/> or /// An <see cref="ActionModel"/> instance for the given action <see cref="MethodInfo"/> or
/// <c>null</c> if the <paramref name="methodInfo"/> does not represent an action. /// <c>null</c> if the <paramref name="methodInfo"/> does not represent an action.
/// </returns> /// </returns>
protected virtual ActionModel CreateActionModel( internal ActionModel CreateActionModel(
TypeInfo typeInfo, TypeInfo typeInfo,
MethodInfo methodInfo) MethodInfo methodInfo)
{ {
@ -381,7 +380,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// <remarks> /// <remarks>
/// Override this method to provide custom logic to determine which methods are considered actions. /// Override this method to provide custom logic to determine which methods are considered actions.
/// </remarks> /// </remarks>
protected virtual bool IsAction(TypeInfo typeInfo, MethodInfo methodInfo) internal bool IsAction(TypeInfo typeInfo, MethodInfo methodInfo)
{ {
if (typeInfo == null) if (typeInfo == null)
{ {
@ -445,7 +444,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// </summary> /// </summary>
/// <param name="parameterInfo">The <see cref="ParameterInfo"/>.</param> /// <param name="parameterInfo">The <see cref="ParameterInfo"/>.</param>
/// <returns>A <see cref="ParameterModel"/> for the given <see cref="ParameterInfo"/>.</returns> /// <returns>A <see cref="ParameterModel"/> for the given <see cref="ParameterInfo"/>.</returns>
protected virtual ParameterModel CreateParameterModel(ParameterInfo parameterInfo) internal ParameterModel CreateParameterModel(ParameterInfo parameterInfo)
{ {
if (parameterInfo == null) if (parameterInfo == null)
{ {

View File

@ -3,7 +3,6 @@
using System; using System;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Routing.Template; using Microsoft.AspNetCore.Routing.Template;
using Resources = Microsoft.AspNetCore.Mvc.Core.Resources; using Resources = Microsoft.AspNetCore.Mvc.Core.Resources;

View File

@ -8,9 +8,9 @@ using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Authorization.Policy; using Microsoft.AspNetCore.Authorization.Policy;
using Microsoft.AspNetCore.Mvc.ApplicationModels;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;

View File

@ -4,10 +4,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Internal;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Internal; using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;

View File

@ -1,14 +1,10 @@
// 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. // 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.Linq; using System.Linq;
using System.Text;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Internal; using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

View File

@ -9,7 +9,6 @@ using Microsoft.AspNetCore.Mvc.ActionConstraints;
using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;
using Resources = Microsoft.AspNetCore.Mvc.Core.Resources; using Resources = Microsoft.AspNetCore.Mvc.Core.Resources;

View File

@ -4,7 +4,6 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.AspNetCore.Mvc namespace Microsoft.AspNetCore.Mvc

View File

@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ModelBinding.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.AspNetCore.Mvc.Routing; using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing;

View File

@ -4,9 +4,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Controllers
{ {
public delegate Task ControllerBinderDelegate( internal delegate Task ControllerBinderDelegate(
ControllerContext controllerContext, ControllerContext controllerContext,
object controller, object controller,
Dictionary<string, object> arguments); Dictionary<string, object> arguments);

View File

@ -7,10 +7,10 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Controllers
{ {
// Note: changes made to binding behavior in type should also be made to PageBinderFactory. // Note: changes made to binding behavior in type should also be made to PageBinderFactory.
public static class ControllerBinderDelegateProvider internal static class ControllerBinderDelegateProvider
{ {
public static ControllerBinderDelegate CreateBinderDelegate( public static ControllerBinderDelegate CreateBinderDelegate(
ParameterBinder parameterBinder, ParameterBinder parameterBinder,

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Internal;
namespace Microsoft.AspNetCore.Mvc.Controllers namespace Microsoft.AspNetCore.Mvc.Controllers
{ {
@ -19,10 +18,7 @@ namespace Microsoft.AspNetCore.Mvc.Controllers
public ControllerFactoryProvider( public ControllerFactoryProvider(
IControllerActivatorProvider activatorProvider, IControllerActivatorProvider activatorProvider,
IControllerFactory controllerFactory, IControllerFactory controllerFactory,
#pragma warning disable PUB0001 // Pubternal type in public API IEnumerable<IControllerPropertyActivator> propertyActivators)
IEnumerable<IControllerPropertyActivator> propertyActivators
#pragma warning restore PUB0001
)
{ {
if (activatorProvider == null) if (activatorProvider == null)
{ {

View File

@ -3,7 +3,7 @@
using System; using System;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Internal; using Microsoft.AspNetCore.Mvc.Infrastructure;
namespace Microsoft.AspNetCore.Mvc.Controllers namespace Microsoft.AspNetCore.Mvc.Controllers
{ {
@ -18,9 +18,7 @@ namespace Microsoft.AspNetCore.Mvc.Controllers
/// Creates a new <see cref="DefaultControllerActivator"/>. /// Creates a new <see cref="DefaultControllerActivator"/>.
/// </summary> /// </summary>
/// <param name="typeActivatorCache">The <see cref="ITypeActivatorCache"/>.</param> /// <param name="typeActivatorCache">The <see cref="ITypeActivatorCache"/>.</param>
#pragma warning disable PUB0001 // Pubternal type in public API
public DefaultControllerActivator(ITypeActivatorCache typeActivatorCache) public DefaultControllerActivator(ITypeActivatorCache typeActivatorCache)
#pragma warning restore PUB0001
{ {
if (typeActivatorCache == null) if (typeActivatorCache == null)
{ {
@ -71,8 +69,7 @@ namespace Microsoft.AspNetCore.Mvc.Controllers
throw new ArgumentNullException(nameof(controller)); throw new ArgumentNullException(nameof(controller));
} }
var disposable = controller as IDisposable; if (controller is IDisposable disposable)
if (disposable != null)
{ {
disposable.Dispose(); disposable.Dispose();
} }

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Internal;
namespace Microsoft.AspNetCore.Mvc.Controllers namespace Microsoft.AspNetCore.Mvc.Controllers
{ {
@ -29,10 +28,7 @@ namespace Microsoft.AspNetCore.Mvc.Controllers
/// </param> /// </param>
public DefaultControllerFactory( public DefaultControllerFactory(
IControllerActivator controllerActivator, IControllerActivator controllerActivator,
#pragma warning disable PUB0001 // Pubternal type in public API IEnumerable<IControllerPropertyActivator> propertyActivators)
IEnumerable<IControllerPropertyActivator> propertyActivators
#pragma warning restore PUB0001
)
{ {
if (controllerActivator == null) if (controllerActivator == null)
{ {

View File

@ -6,13 +6,12 @@ using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.Extensions.Internal; using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Controllers
{ {
public class DefaultControllerPropertyActivator : IControllerPropertyActivator internal class DefaultControllerPropertyActivator : IControllerPropertyActivator
{ {
private static readonly Func<Type, PropertyActivator<ControllerContext>[]> _getPropertiesToActivate = private static readonly Func<Type, PropertyActivator<ControllerContext>[]> _getPropertiesToActivate =
GetPropertiesToActivate; GetPropertiesToActivate;

View File

@ -2,9 +2,8 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using Microsoft.AspNetCore.Mvc.Controllers;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Controllers
{ {
public interface IControllerPropertyActivator public interface IControllerPropertyActivator
{ {

View File

@ -4,14 +4,15 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.Extensions.DependencyInjection
{ {
public class ApiBehaviorOptionsSetup : internal class ApiBehaviorOptionsSetup :
ConfigureCompatibilityOptions<ApiBehaviorOptions>, ConfigureCompatibilityOptions<ApiBehaviorOptions>,
IConfigureOptions<ApiBehaviorOptions> IConfigureOptions<ApiBehaviorOptions>
{ {

View File

@ -3,14 +3,13 @@
using System; using System;
using Microsoft.AspNetCore.Mvc.ApplicationParts; using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.Extensions.DependencyInjection
{ {
/// <summary> /// <summary>
/// Allows fine grained configuration of MVC services. /// Allows fine grained configuration of MVC services.
/// </summary> /// </summary>
public class MvcBuilder : IMvcBuilder internal class MvcBuilder : IMvcBuilder
{ {
/// <summary> /// <summary>
/// Initializes a new <see cref="MvcBuilder"/> instance. /// Initializes a new <see cref="MvcBuilder"/> instance.
@ -39,4 +38,4 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// <inheritdoc /> /// <inheritdoc />
public ApplicationPartManager PartManager { get; } public ApplicationPartManager PartManager { get; }
} }
} }

View File

@ -3,14 +3,13 @@
using System; using System;
using Microsoft.AspNetCore.Mvc.ApplicationParts; using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.Extensions.DependencyInjection
{ {
/// <summary> /// <summary>
/// Allows fine grained configuration of essential MVC services. /// Allows fine grained configuration of essential MVC services.
/// </summary> /// </summary>
public class MvcCoreBuilder : IMvcCoreBuilder internal class MvcCoreBuilder : IMvcCoreBuilder
{ {
/// <summary> /// <summary>
/// Initializes a new <see cref="MvcCoreBuilder"/> instance. /// Initializes a new <see cref="MvcCoreBuilder"/> instance.
@ -41,4 +40,4 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// <inheritdoc /> /// <inheritdoc />
public IServiceCollection Services { get; } public IServiceCollection Services { get; }
} }
} }

View File

@ -11,7 +11,6 @@ using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.DependencyInjection.Extensions;
namespace Microsoft.Extensions.DependencyInjection namespace Microsoft.Extensions.DependencyInjection

View File

@ -6,12 +6,12 @@ using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.Extensions.DependencyInjection
{ {
/// <summary> /// <summary>
/// Sets up MVC default options for <see cref="RouteOptions"/>. /// Sets up MVC default options for <see cref="RouteOptions"/>.
/// </summary> /// </summary>
public class MvcCoreRouteOptionsSetup : IConfigureOptions<RouteOptions> internal class MvcCoreRouteOptionsSetup : IConfigureOptions<RouteOptions>
{ {
/// <summary> /// <summary>
/// Configures the <see cref="RouteOptions"/>. /// Configures the <see cref="RouteOptions"/>.

View File

@ -13,7 +13,6 @@ using Microsoft.AspNetCore.Mvc.ApplicationParts;
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;

View File

@ -1,15 +1,13 @@
// 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.Extensions.DependencyInjection; namespace Microsoft.Extensions.DependencyInjection
namespace Microsoft.AspNetCore.Mvc.Internal
{ {
/// <summary> /// <summary>
/// A marker class used to determine if all the MVC services were added /// A marker class used to determine if all the MVC services were added
/// to the <see cref="IServiceCollection"/> before MVC is configured. /// to the <see cref="IServiceCollection"/> before MVC is configured.
/// </summary> /// </summary>
public class MvcMarkerService internal class MvcMarkerService
{ {
} }
} }

View File

@ -3,7 +3,6 @@
using System; using System;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.AspNetCore.Mvc namespace Microsoft.AspNetCore.Mvc

View File

@ -4,7 +4,6 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;

View File

@ -5,7 +5,6 @@ using System;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;

View File

@ -4,14 +4,13 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Filters;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
/// <summary> /// <summary>
/// A filter implementation which delegates to the controller for action filter interfaces. /// A filter implementation which delegates to the controller for action filter interfaces.
/// </summary> /// </summary>
public class ControllerActionFilter : IAsyncActionFilter, IOrderedFilter internal class ControllerActionFilter : IAsyncActionFilter, IOrderedFilter
{ {
// Controller-filter methods run farthest from the action by default. // Controller-filter methods run farthest from the action by default.
/// <inheritdoc /> /// <inheritdoc />
@ -55,7 +54,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
} }
private static async Task ExecuteActionFilter( private static async Task ExecuteActionFilter(
ActionExecutingContext context, ActionExecutingContext context,
ActionExecutionDelegate next, ActionExecutionDelegate next,
IActionFilter actionFilter) IActionFilter actionFilter)
{ {
@ -66,4 +65,4 @@ namespace Microsoft.AspNetCore.Mvc.Internal
} }
} }
} }
} }

View File

@ -4,14 +4,13 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Filters;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
/// <summary> /// <summary>
/// A filter implementation which delegates to the controller for result filter interfaces. /// A filter implementation which delegates to the controller for result filter interfaces.
/// </summary> /// </summary>
public class ControllerResultFilter : IAsyncResultFilter, IOrderedFilter internal class ControllerResultFilter : IAsyncResultFilter, IOrderedFilter
{ {
// Controller-filter methods run farthest from the result by default. // Controller-filter methods run farthest from the result by default.
/// <inheritdoc /> /// <inheritdoc />
@ -66,4 +65,4 @@ namespace Microsoft.AspNetCore.Mvc.Internal
} }
} }
} }
} }

View File

@ -4,11 +4,10 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Filters;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
public class DefaultFilterProvider : IFilterProvider internal class DefaultFilterProvider : IFilterProvider
{ {
public int Order => -1000; public int Order => -1000;
@ -35,7 +34,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
{ {
} }
public virtual void ProvideFilter(FilterProviderContext context, FilterItem filterItem) public void ProvideFilter(FilterProviderContext context, FilterItem filterItem)
{ {
if (filterItem.Filter != null) if (filterItem.Filter != null)
{ {
@ -44,8 +43,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
var filter = filterItem.Descriptor.Filter; var filter = filterItem.Descriptor.Filter;
var filterFactory = filter as IFilterFactory; if (!(filter is IFilterFactory filterFactory))
if (filterFactory == null)
{ {
filterItem.Filter = filter; filterItem.Filter = filter;
filterItem.IsReusable = true; filterItem.IsReusable = true;
@ -72,9 +70,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
Debug.Assert(actualFilter != null, "actualFilter should not be null"); Debug.Assert(actualFilter != null, "actualFilter should not be null");
Debug.Assert(filterMetadata != null, "filterMetadata should not be null"); Debug.Assert(filterMetadata != null, "filterMetadata should not be null");
var container = actualFilter as IFilterContainer; if (actualFilter is IFilterContainer container)
if (container != null)
{ {
container.FilterDefinition = filterMetadata; container.FilterDefinition = filterMetadata;
} }

View File

@ -3,16 +3,15 @@
using System; using System;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
/// <summary> /// <summary>
/// A filter that sets <see cref="IHttpMaxRequestBodySizeFeature.MaxRequestBodySize"/> /// A filter that sets <see cref="IHttpMaxRequestBodySizeFeature.MaxRequestBodySize"/>
/// to <c>null</c>. /// to <c>null</c>.
/// </summary> /// </summary>
public class DisableRequestSizeLimitFilter : IAuthorizationFilter, IRequestSizePolicy internal class DisableRequestSizeLimitFilter : IAuthorizationFilter, IRequestSizePolicy
{ {
private readonly ILogger _logger; private readonly ILogger _logger;
@ -29,8 +28,8 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// to <c>null</c>. /// to <c>null</c>.
/// </summary> /// </summary>
/// <param name="context">The <see cref="AuthorizationFilterContext"/>.</param> /// <param name="context">The <see cref="AuthorizationFilterContext"/>.</param>
/// <remarks>If <see cref="IHttpMaxRequestBodySizeFeature"/> is not enabled or is read-only, /// <remarks>If <see cref="IHttpMaxRequestBodySizeFeature"/> is not enabled or is read-only,
/// the <see cref="DisableRequestSizeLimitAttribute"/> is not applied.</remarks> /// the <see cref="DisableRequestSizeLimitAttribute"/> is not applied.</remarks>
public void OnAuthorization(AuthorizationFilterContext context) public void OnAuthorization(AuthorizationFilterContext context)
{ {
if (context == null) if (context == null)

View File

@ -1,9 +1,7 @@
// 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Mvc.Filters; namespace Microsoft.AspNetCore.Mvc.Filters
namespace Microsoft.AspNetCore.Mvc.Internal
{ {
/// <summary> /// <summary>
/// A one-way cursor for filters. /// A one-way cursor for filters.
@ -25,7 +23,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// Result /// Result
/// ///
/// </remarks> /// </remarks>
public struct FilterCursor internal struct FilterCursor
{ {
private readonly IFilterMetadata[] _filters; private readonly IFilterMetadata[] _filters;
private int _index; private int _index;

View File

@ -1,9 +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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
public readonly struct FilterCursorItem<TFilter, TFilterAsync> internal readonly struct FilterCursorItem<TFilter, TFilterAsync>
{ {
public FilterCursorItem(TFilter filter, TFilterAsync filterAsync) public FilterCursorItem(TFilter filter, TFilterAsync filterAsync)
{ {

View File

@ -5,9 +5,9 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
public class FilterDescriptorOrderComparer : IComparer<FilterDescriptor> internal class FilterDescriptorOrderComparer : IComparer<FilterDescriptor>
{ {
public static FilterDescriptorOrderComparer Comparer { get; } = new FilterDescriptorOrderComparer(); public static FilterDescriptorOrderComparer Comparer { get; } = new FilterDescriptorOrderComparer();

View File

@ -4,11 +4,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Mvc.Filters;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
public static class FilterFactory internal static class FilterFactory
{ {
public static FilterFactoryResult GetAllFilters( public static FilterFactoryResult GetAllFilters(
IFilterProvider[] filterProviders, IFilterProvider[] filterProviders,

View File

@ -1,11 +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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Mvc.Filters; namespace Microsoft.AspNetCore.Mvc.Filters
namespace Microsoft.AspNetCore.Mvc.Internal
{ {
public readonly struct FilterFactoryResult internal readonly struct FilterFactoryResult
{ {
public FilterFactoryResult( public FilterFactoryResult(
FilterItem[] cacheableFilters, FilterItem[] cacheableFilters,

View File

@ -1,19 +1,17 @@
// 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Mvc.Filters; namespace Microsoft.AspNetCore.Mvc.Filters
namespace Microsoft.AspNetCore.Mvc.Internal
{ {
/// <summary> /// <summary>
/// A feature in <see cref="Microsoft.AspNetCore.Http.HttpContext.Features"/> which is used to capture the /// A feature in <see cref="Microsoft.AspNetCore.Http.HttpContext.Features"/> which is used to capture the
/// currently executing context of a resource filter. This feature is used in the final middleware /// currently executing context of a resource filter. This feature is used in the final middleware
/// of a middleware filter's pipeline to keep the request flow through the rest of the MVC layers. /// of a middleware filter's pipeline to keep the request flow through the rest of the MVC layers.
/// </summary> /// </summary>
public interface IMiddlewareFilterFeature internal interface IMiddlewareFilterFeature
{ {
ResourceExecutingContext ResourceExecutingContext { get; } ResourceExecutingContext ResourceExecutingContext { get; }
ResourceExecutionDelegate ResourceExecutionDelegate { get; } ResourceExecutionDelegate ResourceExecutionDelegate { get; }
} }
} }

View File

@ -1,14 +1,12 @@
// 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Mvc.Filters; namespace Microsoft.AspNetCore.Mvc.Filters
namespace Microsoft.AspNetCore.Mvc.Internal
{ {
/// <summary> /// <summary>
/// A filter which sets the appropriate headers related to Response caching. /// A filter which sets the appropriate headers related to Response caching.
/// </summary> /// </summary>
public interface IResponseCacheFilter : IFilterMetadata internal interface IResponseCacheFilter : IFilterMetadata
{ {
} }
} }

View File

@ -6,7 +6,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
/// <summary> /// <summary>
/// A filter which executes a user configured middleware pipeline. /// A filter which executes a user configured middleware pipeline.

View File

@ -3,7 +3,6 @@
using System; using System;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.AspNetCore.Mvc namespace Microsoft.AspNetCore.Mvc

View File

@ -7,12 +7,12 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
/// <summary> /// <summary>
/// Builds a middleware pipeline after receiving the pipeline from a pipeline provider /// Builds a middleware pipeline after receiving the pipeline from a pipeline provider
/// </summary> /// </summary>
public class MiddlewareFilterBuilder internal class MiddlewareFilterBuilder
{ {
// 'GetOrAdd' call on the dictionary is not thread safe and we might end up creating the pipeline more // 'GetOrAdd' call on the dictionary is not thread safe and we might end up creating the pipeline more
// once. To prevent this Lazy<> is used. In the worst case multiple Lazy<> objects are created for multiple // once. To prevent this Lazy<> is used. In the worst case multiple Lazy<> objects are created for multiple

View File

@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
internal class MiddlewareFilterBuilderStartupFilter : IStartupFilter internal class MiddlewareFilterBuilderStartupFilter : IStartupFilter
{ {
@ -23,4 +23,4 @@ namespace Microsoft.AspNetCore.Mvc.Internal
} }
} }
} }
} }

View File

@ -8,13 +8,13 @@ using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
/// <summary> /// <summary>
/// Calls into user provided 'Configure' methods for configuring a middleware pipeline. The semantics of finding /// Calls into user provided 'Configure' methods for configuring a middleware pipeline. The semantics of finding
/// the 'Configure' methods is similar to the application Startup class. /// the 'Configure' methods is similar to the application Startup class.
/// </summary> /// </summary>
public class MiddlewareFilterConfigurationProvider internal class MiddlewareFilterConfigurationProvider
{ {
public Action<IApplicationBuilder> CreateConfigureDelegate(Type configurationType) public Action<IApplicationBuilder> CreateConfigureDelegate(Type configurationType)
{ {

View File

@ -1,11 +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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.AspNetCore.Mvc.Filters; namespace Microsoft.AspNetCore.Mvc.Filters
namespace Microsoft.AspNetCore.Mvc.Internal
{ {
public class MiddlewareFilterFeature : IMiddlewareFilterFeature internal class MiddlewareFilterFeature : IMiddlewareFilterFeature
{ {
public ResourceExecutingContext ResourceExecutingContext { get; set; } public ResourceExecutingContext ResourceExecutingContext { get; set; }

View File

@ -3,15 +3,14 @@
using System; using System;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
/// <summary> /// <summary>
/// A filter that configures <see cref="FormOptions"/> for the current request. /// A filter that configures <see cref="FormOptions"/> for the current request.
/// </summary> /// </summary>
public class RequestFormLimitsFilter : IAuthorizationFilter, IRequestFormLimitsPolicy internal class RequestFormLimitsFilter : IAuthorizationFilter, IRequestFormLimitsPolicy
{ {
private readonly ILogger _logger; private readonly ILogger _logger;

View File

@ -3,16 +3,15 @@
using System; using System;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
/// <summary> /// <summary>
/// A filter that sets the <see cref="IHttpMaxRequestBodySizeFeature.MaxRequestBodySize"/> /// A filter that sets the <see cref="IHttpMaxRequestBodySizeFeature.MaxRequestBodySize"/>
/// to the specified <see cref="Bytes"/>. /// to the specified <see cref="Bytes"/>.
/// </summary> /// </summary>
public class RequestSizeLimitFilter : IAuthorizationFilter, IRequestSizePolicy internal class RequestSizeLimitFilter : IAuthorizationFilter, IRequestSizePolicy
{ {
private readonly ILogger _logger; private readonly ILogger _logger;
@ -30,7 +29,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// Sets the <see cref="IHttpMaxRequestBodySizeFeature.MaxRequestBodySize"/> to <see cref="Bytes"/>. /// Sets the <see cref="IHttpMaxRequestBodySizeFeature.MaxRequestBodySize"/> to <see cref="Bytes"/>.
/// </summary> /// </summary>
/// <param name="context">The <see cref="AuthorizationFilterContext"/>.</param> /// <param name="context">The <see cref="AuthorizationFilterContext"/>.</param>
/// <remarks>If <see cref="IHttpMaxRequestBodySizeFeature"/> is not enabled or is read-only, /// <remarks>If <see cref="IHttpMaxRequestBodySizeFeature"/> is not enabled or is read-only,
/// the <see cref="RequestSizeLimitAttribute"/> is not applied.</remarks> /// the <see cref="RequestSizeLimitAttribute"/> is not applied.</remarks>
public void OnAuthorization(AuthorizationFilterContext context) public void OnAuthorization(AuthorizationFilterContext context)
{ {

View File

@ -2,15 +2,14 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
/// <summary> /// <summary>
/// An <see cref="IActionFilter"/> which sets the appropriate headers related to response caching. /// An <see cref="IActionFilter"/> which sets the appropriate headers related to response caching.
/// </summary> /// </summary>
public class ResponseCacheFilter : IActionFilter, IResponseCacheFilter internal class ResponseCacheFilter : IActionFilter, IResponseCacheFilter
{ {
private readonly ResponseCacheFilterExecutor _executor; private readonly ResponseCacheFilterExecutor _executor;
private readonly ILogger _logger; private readonly ILogger _logger;
@ -105,4 +104,4 @@ namespace Microsoft.AspNetCore.Mvc.Internal
{ {
} }
} }
} }

View File

@ -2,16 +2,14 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using System.Diagnostics;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.ResponseCaching; using Microsoft.AspNetCore.ResponseCaching;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Filters
{ {
public class ResponseCacheFilterExecutor internal class ResponseCacheFilterExecutor
{ {
private readonly CacheProfile _cacheProfile; private readonly CacheProfile _cacheProfile;
private int? _cacheDuration; private int? _cacheDuration;

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;

View File

@ -5,9 +5,9 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
namespace Microsoft.AspNetCore.Mvc.Formatters.Internal namespace Microsoft.AspNetCore.Mvc.Formatters
{ {
public static class AcceptHeaderParser internal static class AcceptHeaderParser
{ {
public static IList<MediaTypeSegmentWithQuality> ParseAcceptHeader(IList<string> acceptHeaders) public static IList<MediaTypeSegmentWithQuality> ParseAcceptHeader(IList<string> acceptHeaders)
{ {
@ -78,7 +78,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Internal
} }
// We deliberately want to ignore media types that we are not capable of parsing. // We deliberately want to ignore media types that we are not capable of parsing.
// This is due to the fact that some browsers will send invalid media types like // This is due to the fact that some browsers will send invalid media types like
// ; q=0.9 or */;q=0.2, etc. // ; q=0.9 or */;q=0.2, etc.
// In this scenario, our recovery action consists of advancing the pointer to the // In this scenario, our recovery action consists of advancing the pointer to the
// next separator and moving on. // next separator and moving on.

View File

@ -6,8 +6,6 @@ using System.Globalization;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Mvc.ApiExplorer; using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.Formatters.Internal;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;

View File

@ -1,9 +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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.AspNetCore.Mvc.Formatters.Internal namespace Microsoft.AspNetCore.Mvc.Formatters
{ {
public enum HttpParseResult internal enum HttpParseResult
{ {
Parsed, Parsed,
NotParsed, NotParsed,

View File

@ -4,9 +4,9 @@
using System.Diagnostics.Contracts; using System.Diagnostics.Contracts;
using System.Text; using System.Text;
namespace Microsoft.AspNetCore.Mvc.Formatters.Internal namespace Microsoft.AspNetCore.Mvc.Formatters
{ {
public static class HttpTokenParsingRules internal static class HttpTokenParsingRules
{ {
private static readonly bool[] TokenChars; private static readonly bool[] TokenChars;
private const int MaxNestedCount = 5; private const int MaxNestedCount = 5;

View File

@ -3,12 +3,12 @@
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
namespace Microsoft.AspNetCore.Mvc.Formatters.Internal namespace Microsoft.AspNetCore.Mvc.Formatters
{ {
/// <summary> /// <summary>
/// A filter that produces the desired content type for the request. /// A filter that produces the desired content type for the request.
/// </summary> /// </summary>
public interface IFormatFilter : IFilterMetadata internal interface IFormatFilter : IFilterMetadata
{ {
/// <summary> /// <summary>
/// Gets the format value for the request associated with the provided <see cref="ActionContext"/>. /// Gets the format value for the request associated with the provided <see cref="ActionContext"/>.
@ -17,4 +17,4 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Internal
/// <returns>A format value, or <c>null</c> if a format cannot be determined for the request.</returns> /// <returns>A format value, or <c>null</c> if a format cannot be determined for the request.</returns>
string GetFormat(ActionContext context); string GetFormat(ActionContext context);
} }
} }

View File

@ -5,7 +5,6 @@ using System;
using System.Globalization; using System.Globalization;
using System.Text; using System.Text;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Formatters.Internal;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
namespace Microsoft.AspNetCore.Mvc.Formatters namespace Microsoft.AspNetCore.Mvc.Formatters
@ -393,9 +392,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters
/// <param name="mediaType">The media type to parse.</param> /// <param name="mediaType">The media type to parse.</param>
/// <param name="start">The position at which the parsing starts.</param> /// <param name="start">The position at which the parsing starts.</param>
/// <returns>The parsed media type with its associated quality.</returns> /// <returns>The parsed media type with its associated quality.</returns>
#pragma warning disable PUB0001 // Pubternal type in public API
public static MediaTypeSegmentWithQuality CreateMediaTypeSegmentWithQuality(string mediaType, int start) public static MediaTypeSegmentWithQuality CreateMediaTypeSegmentWithQuality(string mediaType, int start)
#pragma warning restore PUB0001
{ {
var parsedMediaType = new MediaType(mediaType, start, length: null); var parsedMediaType = new MediaType(mediaType, start, length: null);

View File

@ -3,7 +3,7 @@
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;
namespace Microsoft.AspNetCore.Mvc.Formatters.Internal namespace Microsoft.AspNetCore.Mvc.Formatters
{ {
/// <summary> /// <summary>
/// A media type with its associated quality. /// A media type with its associated quality.

View File

@ -4,11 +4,10 @@
using System.Diagnostics; using System.Diagnostics;
using System.Text; using System.Text;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Formatters;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Formatters
{ {
public static class ResponseContentTypeHelper internal static class ResponseContentTypeHelper
{ {
/// <summary> /// <summary>
/// Gets the content type and encoding that need to be used for the response. /// Gets the content type and encoding that need to be used for the response.

View File

@ -4,11 +4,10 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.Infrastructure;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
public class ActionInvokerFactory : IActionInvokerFactory internal class ActionInvokerFactory : IActionInvokerFactory
{ {
private readonly IActionInvokerProvider[] _actionInvokerProviders; private readonly IActionInvokerProvider[] _actionInvokerProviders;

View File

@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.Extensions.Internal; using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
internal abstract class ActionMethodExecutor internal abstract class ActionMethodExecutor
{ {

View File

@ -2,11 +2,10 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using Microsoft.AspNetCore.Mvc.Infrastructure;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
public class ActionResultTypeMapper : IActionResultTypeMapper internal class ActionResultTypeMapper : IActionResultTypeMapper
{ {
public Type GetResultDataType(Type returnType) public Type GetResultDataType(Type returnType)
{ {
@ -15,7 +14,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
throw new ArgumentNullException(nameof(returnType)); throw new ArgumentNullException(nameof(returnType));
} }
if (returnType.IsGenericType && if (returnType.IsGenericType &&
returnType.GetGenericTypeDefinition() == typeof(ActionResult<>)) returnType.GetGenericTypeDefinition() == typeof(ActionResult<>))
{ {
return returnType.GetGenericArguments()[0]; return returnType.GetGenericArguments()[0];

View File

@ -15,12 +15,12 @@ using Microsoft.Extensions.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Resources = Microsoft.AspNetCore.Mvc.Core.Resources; using Resources = Microsoft.AspNetCore.Mvc.Core.Resources;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
/// <summary> /// <summary>
/// A default <see cref="IActionSelector"/> implementation. /// A default <see cref="IActionSelector"/> implementation.
/// </summary> /// </summary>
public class ActionSelector : IActionSelector internal class ActionSelector : IActionSelector
{ {
private static readonly IReadOnlyList<ActionDescriptor> EmptyActions = Array.Empty<ActionDescriptor>(); private static readonly IReadOnlyList<ActionDescriptor> EmptyActions = Array.Empty<ActionDescriptor>();
@ -146,7 +146,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// </summary> /// </summary>
/// <param name="actions">The set of actions that satisfy all constraints.</param> /// <param name="actions">The set of actions that satisfy all constraints.</param>
/// <returns>A list of the best matching actions.</returns> /// <returns>A list of the best matching actions.</returns>
protected virtual IReadOnlyList<ActionDescriptor> SelectBestActions(IReadOnlyList<ActionDescriptor> actions) private IReadOnlyList<ActionDescriptor> SelectBestActions(IReadOnlyList<ActionDescriptor> actions)
{ {
return actions; return actions;
} }

View File

@ -4,13 +4,13 @@
using System; using System;
using System.Runtime.Serialization; using System.Runtime.Serialization;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
/// <summary> /// <summary>
/// An exception which indicates multiple matches in action selection. /// An exception which indicates multiple matches in action selection.
/// </summary> /// </summary>
[Serializable] [Serializable]
public class AmbiguousActionException : InvalidOperationException internal class AmbiguousActionException : InvalidOperationException
{ {
public AmbiguousActionException(string message) public AmbiguousActionException(string message)
: base(message) : base(message)

View File

@ -3,7 +3,6 @@
using System; using System;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Mvc.Infrastructure namespace Microsoft.AspNetCore.Mvc.Infrastructure

View File

@ -2,9 +2,8 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Internal; using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Mvc.Infrastructure namespace Microsoft.AspNetCore.Mvc.Infrastructure
@ -36,14 +35,12 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
var response = context.HttpContext.Response; var response = context.HttpContext.Response;
string resolvedContentType;
Encoding resolvedContentTypeEncoding;
ResponseContentTypeHelper.ResolveContentTypeAndEncoding( ResponseContentTypeHelper.ResolveContentTypeAndEncoding(
result.ContentType, result.ContentType,
response.ContentType, response.ContentType,
DefaultContentType, DefaultContentType,
out resolvedContentType, out var resolvedContentType,
out resolvedContentTypeEncoding); out var resolvedContentTypeEncoding);
response.ContentType = resolvedContentType; response.ContentType = resolvedContentType;

View File

@ -8,14 +8,13 @@ using System.Runtime.ExceptionServices;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.Extensions.Internal; using Microsoft.Extensions.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Resources = Microsoft.AspNetCore.Mvc.Core.Resources; using Resources = Microsoft.AspNetCore.Mvc.Core.Resources;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
public class ControllerActionInvoker : ResourceInvoker, IActionInvoker internal class ControllerActionInvoker : ResourceInvoker, IActionInvoker
{ {
private readonly ControllerActionInvokerCacheEntry _cacheEntry; private readonly ControllerActionInvokerCacheEntry _cacheEntry;
private readonly ControllerContext _controllerContext; private readonly ControllerContext _controllerContext;

View File

@ -12,9 +12,9 @@ using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.Extensions.Internal; using Microsoft.Extensions.Internal;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
public class ControllerActionInvokerCache internal class ControllerActionInvokerCache
{ {
private readonly IActionDescriptorCollectionProvider _collectionProvider; private readonly IActionDescriptorCollectionProvider _collectionProvider;
private readonly ParameterBinder _parameterBinder; private readonly ParameterBinder _parameterBinder;

View File

@ -2,12 +2,13 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System; using System;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Internal; using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
public class ControllerActionInvokerCacheEntry internal class ControllerActionInvokerCacheEntry
{ {
internal ControllerActionInvokerCacheEntry( internal ControllerActionInvokerCacheEntry(
FilterItem[] cachedFilters, FilterItem[] cachedFilters,

View File

@ -7,14 +7,13 @@ using System.Diagnostics;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Mvc.Abstractions; using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
public class ControllerActionInvokerProvider : IActionInvokerProvider internal class ControllerActionInvokerProvider : IActionInvokerProvider
{ {
private readonly ControllerActionInvokerCache _controllerActionInvokerCache; private readonly ControllerActionInvokerCache _controllerActionInvokerCache;
private readonly IReadOnlyList<IValueProviderFactory> _valueProviderFactories; private readonly IReadOnlyList<IValueProviderFactory> _valueProviderFactories;

View File

@ -4,9 +4,9 @@
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
public class CopyOnWriteList<T> : IList<T> internal class CopyOnWriteList<T> : IList<T>
{ {
private readonly IReadOnlyList<T> _source; private readonly IReadOnlyList<T> _source;
private List<T> _copy; private List<T> _copy;
@ -16,9 +16,9 @@ namespace Microsoft.AspNetCore.Mvc.Internal
_source = source; _source = source;
} }
protected IReadOnlyList<T> Readable => _copy ?? _source; private IReadOnlyList<T> Readable => _copy ?? _source;
protected List<T> Writable private List<T> Writable
{ {
get get
{ {

View File

@ -7,8 +7,6 @@ using System.Collections.ObjectModel;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.AspNetCore.Mvc.Formatters.Internal;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Microsoft.Extensions.Primitives; using Microsoft.Extensions.Primitives;

View File

@ -4,7 +4,6 @@
using System; using System;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;

View File

@ -10,7 +10,6 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Extensions; using Microsoft.AspNetCore.Http.Extensions;
using Microsoft.AspNetCore.Http.Headers; using Microsoft.AspNetCore.Http.Headers;
using Microsoft.AspNetCore.Internal; using Microsoft.AspNetCore.Internal;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;

View File

@ -3,7 +3,6 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;

View File

@ -36,7 +36,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure
/// <param name="context">The <see cref="RouteContext"/> associated with the current request.</param> /// <param name="context">The <see cref="RouteContext"/> associated with the current request.</param>
/// <param name="candidates">The set of <see cref="ActionDescriptor"/> candidates.</param> /// <param name="candidates">The set of <see cref="ActionDescriptor"/> candidates.</param>
/// <returns>The best <see cref="ActionDescriptor"/> candidate for the current request or <c>null</c>.</returns> /// <returns>The best <see cref="ActionDescriptor"/> candidate for the current request or <c>null</c>.</returns>
/// <exception cref="Internal.AmbiguousActionException"> /// <exception cref="AmbiguousActionException">
/// Thrown when action selection results in an ambiguity. /// Thrown when action selection results in an ambiguity.
/// </exception> /// </exception>
/// <remarks> /// <remarks>

View File

@ -3,10 +3,10 @@
using System; using System;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
/// <summary> /// <summary>
/// Caches <see cref="Microsoft.Extensions.DependencyInjection.ObjectFactory"/> instances produced by /// Caches <see cref="Microsoft.Extensions.DependencyInjection.ObjectFactory"/> instances produced by
/// <see cref="Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateFactory(Type, Type[])"/>. /// <see cref="Microsoft.Extensions.DependencyInjection.ActivatorUtilities.CreateFactory(Type, Type[])"/>.
/// </summary> /// </summary>
public interface ITypeActivatorCache public interface ITypeActivatorCache
@ -19,4 +19,4 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// <param name="optionType">The <see cref="Type"/> of the <typeparamref name="TInstance"/> to create.</param> /// <param name="optionType">The <see cref="Type"/> of the <typeparamref name="TInstance"/> to create.</param>
TInstance CreateInstance<TInstance>(IServiceProvider serviceProvider, Type optionType); TInstance CreateInstance<TInstance>(IServiceProvider serviceProvider, Type optionType);
} }
} }

View File

@ -5,7 +5,6 @@ using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.Routing; using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;

View File

@ -5,15 +5,14 @@ using System;
using System.Buffers; using System.Buffers;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.WebUtilities; using Microsoft.AspNetCore.WebUtilities;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
/// <summary> /// <summary>
/// An <see cref="IHttpRequestStreamReaderFactory"/> that uses pooled buffers. /// An <see cref="IHttpRequestStreamReaderFactory"/> that uses pooled buffers.
/// </summary> /// </summary>
public class MemoryPoolHttpRequestStreamReaderFactory : IHttpRequestStreamReaderFactory internal class MemoryPoolHttpRequestStreamReaderFactory : IHttpRequestStreamReaderFactory
{ {
/// <summary> /// <summary>
/// The default size of created char buffers. /// The default size of created char buffers.

View File

@ -5,15 +5,14 @@ using System;
using System.Buffers; using System.Buffers;
using System.IO; using System.IO;
using System.Text; using System.Text;
using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.WebUtilities; using Microsoft.AspNetCore.WebUtilities;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
/// <summary> /// <summary>
/// An <see cref="IHttpResponseStreamWriterFactory"/> that uses pooled buffers. /// An <see cref="IHttpResponseStreamWriterFactory"/> that uses pooled buffers.
/// </summary> /// </summary>
public class MemoryPoolHttpResponseStreamWriterFactory : IHttpResponseStreamWriterFactory internal class MemoryPoolHttpResponseStreamWriterFactory : IHttpResponseStreamWriterFactory
{ {
/// <summary> /// <summary>
/// The default size of buffers <see cref="HttpResponseStreamWriter"/>s will allocate. /// The default size of buffers <see cref="HttpResponseStreamWriter"/>s will allocate.

View File

@ -4,7 +4,6 @@
using System; using System;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Mvc.Infrastructure namespace Microsoft.AspNetCore.Mvc.Infrastructure

View File

@ -9,7 +9,7 @@ using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Mvc.Infrastructure namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
internal sealed class ModelStateInvalidFilterFactory : IFilterFactory, IOrderedFilter internal class ModelStateInvalidFilterFactory : IFilterFactory, IOrderedFilter
{ {
public int Order => ModelStateInvalidFilter.FilterOrder; public int Order => ModelStateInvalidFilter.FilterOrder;

View File

@ -8,7 +8,6 @@ using System.Threading;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.Mvc.Infrastructure;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ModelBinding.Binders; using Microsoft.AspNetCore.Mvc.ModelBinding.Binders;
using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata;

View File

@ -6,14 +6,14 @@ using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
/// <summary> /// <summary>
/// Stream that delegates to an inner stream. /// Stream that delegates to an inner stream.
/// This Stream is present so that the inner stream is not closed /// This Stream is present so that the inner stream is not closed
/// even when Close() or Dispose() is called. /// even when Close() or Dispose() is called.
/// </summary> /// </summary>
public class NonDisposableStream : Stream internal class NonDisposableStream : Stream
{ {
private readonly Stream _innerStream; private readonly Stream _innerStream;
@ -34,7 +34,7 @@ namespace Microsoft.AspNetCore.Mvc.Internal
/// <summary> /// <summary>
/// The inner stream this object delegates to. /// The inner stream this object delegates to.
/// </summary> /// </summary>
protected Stream InnerStream => _innerStream; private Stream InnerStream => _innerStream;
/// <inheritdoc /> /// <inheritdoc />
public override bool CanRead => _innerStream.CanRead; public override bool CanRead => _innerStream.CanRead;

View File

@ -9,7 +9,6 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Formatters;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
namespace Microsoft.AspNetCore.Mvc.Infrastructure namespace Microsoft.AspNetCore.Mvc.Infrastructure

View File

@ -6,9 +6,9 @@ using System.ComponentModel;
using System.Reflection; using System.Reflection;
using Microsoft.Extensions.Internal; using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Mvc.Internal namespace Microsoft.AspNetCore.Mvc.Infrastructure
{ {
public static class ParameterDefaultValues internal static class ParameterDefaultValues
{ {
public static object[] GetParameterDefaultValues(MethodInfo methodInfo) public static object[] GetParameterDefaultValues(MethodInfo methodInfo)
{ {

View File

@ -7,7 +7,6 @@ using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;

View File

@ -4,7 +4,6 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.Routing; using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;

View File

@ -5,7 +5,6 @@ using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.Routing; using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;

View File

@ -5,7 +5,6 @@ using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Core; using Microsoft.AspNetCore.Mvc.Core;
using Microsoft.AspNetCore.Mvc.Internal;
using Microsoft.AspNetCore.Mvc.Routing; using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;

Some files were not shown because too many files have changed in this diff Show More