diff --git a/src/Microsoft.AspNetCore.Mvc.Cors/Internal/CorsApplicationModelProvider.cs b/src/Microsoft.AspNetCore.Mvc.Cors/CorsApplicationModelProvider.cs similarity index 97% rename from src/Microsoft.AspNetCore.Mvc.Cors/Internal/CorsApplicationModelProvider.cs rename to src/Microsoft.AspNetCore.Mvc.Cors/CorsApplicationModelProvider.cs index 8344a8ca19..5afd4e6385 100644 --- a/src/Microsoft.AspNetCore.Mvc.Cors/Internal/CorsApplicationModelProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.Cors/CorsApplicationModelProvider.cs @@ -8,9 +8,9 @@ using Microsoft.AspNetCore.Mvc.ActionConstraints; using Microsoft.AspNetCore.Mvc.ApplicationModels; using Microsoft.AspNetCore.Routing; -namespace Microsoft.AspNetCore.Mvc.Cors.Internal +namespace Microsoft.AspNetCore.Mvc.Cors { - public class CorsApplicationModelProvider : IApplicationModelProvider + internal class CorsApplicationModelProvider : IApplicationModelProvider { public int Order => -1000 + 10; diff --git a/src/Microsoft.AspNetCore.Mvc.Cors/CorsAuthorizationFilter.cs b/src/Microsoft.AspNetCore.Mvc.Cors/CorsAuthorizationFilter.cs index 0d853eae9d..d4b374849d 100644 --- a/src/Microsoft.AspNetCore.Mvc.Cors/CorsAuthorizationFilter.cs +++ b/src/Microsoft.AspNetCore.Mvc.Cors/CorsAuthorizationFilter.cs @@ -5,7 +5,6 @@ using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Cors.Infrastructure; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc.Cors.Internal; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Primitives; diff --git a/src/Microsoft.AspNetCore.Mvc.Cors/Internal/CorsAuthorizationFilterFactory.cs b/src/Microsoft.AspNetCore.Mvc.Cors/CorsAuthorizationFilterFactory.cs similarity index 92% rename from src/Microsoft.AspNetCore.Mvc.Cors/Internal/CorsAuthorizationFilterFactory.cs rename to src/Microsoft.AspNetCore.Mvc.Cors/CorsAuthorizationFilterFactory.cs index 9cb7146f5c..517a85aea1 100644 --- a/src/Microsoft.AspNetCore.Mvc.Cors/Internal/CorsAuthorizationFilterFactory.cs +++ b/src/Microsoft.AspNetCore.Mvc.Cors/CorsAuthorizationFilterFactory.cs @@ -5,12 +5,12 @@ using System; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.DependencyInjection; -namespace Microsoft.AspNetCore.Mvc.Cors.Internal +namespace Microsoft.AspNetCore.Mvc.Cors { /// /// A filter factory which creates a new instance of . /// - public class CorsAuthorizationFilterFactory : IFilterFactory, IOrderedFilter + internal class CorsAuthorizationFilterFactory : IFilterFactory, IOrderedFilter { private readonly string _policyName; diff --git a/src/Microsoft.AspNetCore.Mvc.Cors/Internal/CorsHttpMethodActionConstraint.cs b/src/Microsoft.AspNetCore.Mvc.Cors/CorsHttpMethodActionConstraint.cs similarity index 100% rename from src/Microsoft.AspNetCore.Mvc.Cors/Internal/CorsHttpMethodActionConstraint.cs rename to src/Microsoft.AspNetCore.Mvc.Cors/CorsHttpMethodActionConstraint.cs diff --git a/src/Microsoft.AspNetCore.Mvc.Cors/Internal/CorsLoggerExtensions.cs b/src/Microsoft.AspNetCore.Mvc.Cors/CorsLoggerExtensions.cs similarity index 89% rename from src/Microsoft.AspNetCore.Mvc.Cors/Internal/CorsLoggerExtensions.cs rename to src/Microsoft.AspNetCore.Mvc.Cors/CorsLoggerExtensions.cs index c3fab172b9..8bc4af91f4 100644 --- a/src/Microsoft.AspNetCore.Mvc.Cors/Internal/CorsLoggerExtensions.cs +++ b/src/Microsoft.AspNetCore.Mvc.Cors/CorsLoggerExtensions.cs @@ -4,9 +4,9 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Mvc.Cors.Internal +namespace Microsoft.AspNetCore.Mvc.Cors { - public static class CorsLoggerExtensions + internal static class CorsLoggerExtensions { private static readonly Action _notMostEffectiveFilter; diff --git a/src/Microsoft.AspNetCore.Mvc.Cors/DependencyInjection/MvcCorsMvcCoreBuilderExtensions.cs b/src/Microsoft.AspNetCore.Mvc.Cors/DependencyInjection/MvcCorsMvcCoreBuilderExtensions.cs index a4cf5c1800..460a0cb4f9 100644 --- a/src/Microsoft.AspNetCore.Mvc.Cors/DependencyInjection/MvcCorsMvcCoreBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.Mvc.Cors/DependencyInjection/MvcCorsMvcCoreBuilderExtensions.cs @@ -5,7 +5,6 @@ using System; using Microsoft.AspNetCore.Cors.Infrastructure; using Microsoft.AspNetCore.Mvc.ApplicationModels; using Microsoft.AspNetCore.Mvc.Cors; -using Microsoft.AspNetCore.Mvc.Cors.Internal; using Microsoft.Extensions.DependencyInjection.Extensions; namespace Microsoft.Extensions.DependencyInjection diff --git a/src/Microsoft.AspNetCore.Mvc.Cors/Internal/DisableCorsAuthorizationFilter.cs b/src/Microsoft.AspNetCore.Mvc.Cors/DisableCorsAuthorizationFilter.cs similarity index 93% rename from src/Microsoft.AspNetCore.Mvc.Cors/Internal/DisableCorsAuthorizationFilter.cs rename to src/Microsoft.AspNetCore.Mvc.Cors/DisableCorsAuthorizationFilter.cs index 8ecd6cbfb6..183add11a9 100644 --- a/src/Microsoft.AspNetCore.Mvc.Cors/Internal/DisableCorsAuthorizationFilter.cs +++ b/src/Microsoft.AspNetCore.Mvc.Cors/DisableCorsAuthorizationFilter.cs @@ -8,12 +8,12 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Primitives; -namespace Microsoft.AspNetCore.Mvc.Cors.Internal +namespace Microsoft.AspNetCore.Mvc.Cors { /// /// An which ensures that an action does not run for a pre-flight request. /// - public class DisableCorsAuthorizationFilter : ICorsAuthorizationFilter + internal class DisableCorsAuthorizationFilter : ICorsAuthorizationFilter { /// // Since clients' preflight requests would not have data to authenticate requests, this diff --git a/src/Microsoft.AspNetCore.Mvc.Cors/Internal/ICorsAuthorizationFilter.cs b/src/Microsoft.AspNetCore.Mvc.Cors/ICorsAuthorizationFilter.cs similarity index 71% rename from src/Microsoft.AspNetCore.Mvc.Cors/Internal/ICorsAuthorizationFilter.cs rename to src/Microsoft.AspNetCore.Mvc.Cors/ICorsAuthorizationFilter.cs index 6989ffd421..483a70980d 100644 --- a/src/Microsoft.AspNetCore.Mvc.Cors/Internal/ICorsAuthorizationFilter.cs +++ b/src/Microsoft.AspNetCore.Mvc.Cors/ICorsAuthorizationFilter.cs @@ -3,12 +3,12 @@ using Microsoft.AspNetCore.Mvc.Filters; -namespace Microsoft.AspNetCore.Mvc.Cors.Internal +namespace Microsoft.AspNetCore.Mvc.Cors { /// /// A filter that can be used to enable/disable CORS support for a resource. /// - public interface ICorsAuthorizationFilter : IAsyncAuthorizationFilter, IOrderedFilter + internal interface ICorsAuthorizationFilter : IAsyncAuthorizationFilter, IOrderedFilter { } } diff --git a/src/Microsoft.AspNetCore.Mvc.Cors/breakingchanges.netcore.json b/src/Microsoft.AspNetCore.Mvc.Cors/breakingchanges.netcore.json new file mode 100644 index 0000000000..6c3a2d285c --- /dev/null +++ b/src/Microsoft.AspNetCore.Mvc.Cors/breakingchanges.netcore.json @@ -0,0 +1,6 @@ +[ + { + "TypeId": "public class Microsoft.AspNetCore.Mvc.Cors.CorsAuthorizationFilter : Microsoft.AspNetCore.Mvc.Cors.Internal.ICorsAuthorizationFilter", + "Kind": "Removal" + } +] diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/CompareAttributeAdapter.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/CompareAttributeAdapter.cs similarity index 97% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/CompareAttributeAdapter.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/CompareAttributeAdapter.cs index f64272fa04..43e60f89e5 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/CompareAttributeAdapter.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/CompareAttributeAdapter.cs @@ -8,9 +8,9 @@ using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.Localization; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { - public class CompareAttributeAdapter : AttributeAdapterBase + internal class CompareAttributeAdapter : AttributeAdapterBase { private readonly string _otherProperty; @@ -105,4 +105,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataAnnotationsClientModelValidatorProvider.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsClientModelValidatorProvider.cs similarity index 96% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataAnnotationsClientModelValidatorProvider.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsClientModelValidatorProvider.cs index 05d2aacac3..946db2b755 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataAnnotationsClientModelValidatorProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsClientModelValidatorProvider.cs @@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { /// /// An implementation of which provides client validators @@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal /// The logic to support /// is implemented in . /// - public class DataAnnotationsClientModelValidatorProvider : IClientModelValidatorProvider + internal class DataAnnotationsClientModelValidatorProvider : IClientModelValidatorProvider { private readonly IOptions _options; private readonly IStringLocalizerFactory _stringLocalizerFactory; diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataAnnotationsLocalizationServices.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsLocalizationServices.cs similarity index 90% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataAnnotationsLocalizationServices.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsLocalizationServices.cs index 3ef1fde707..75c6a013fc 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataAnnotationsLocalizationServices.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsLocalizationServices.cs @@ -6,9 +6,9 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { - public static class DataAnnotationsLocalizationServices + internal static class DataAnnotationsLocalizationServices { public static void AddDataAnnotationsLocalizationServices( IServiceCollection services, diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataAnnotationsMetadataProvider.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsMetadataProvider.cs similarity index 99% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataAnnotationsMetadataProvider.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsMetadataProvider.cs index d0a2875c5a..e94ee78153 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataAnnotationsMetadataProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsMetadataProvider.cs @@ -12,13 +12,13 @@ using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { /// /// An implementation of and for /// the System.ComponentModel.DataAnnotations attribute classes. /// - public class DataAnnotationsMetadataProvider : + internal class DataAnnotationsMetadataProvider : IBindingMetadataProvider, IDisplayMetadataProvider, IValidationMetadataProvider @@ -388,4 +388,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal return string.Empty; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataAnnotationsModelValidator.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsModelValidator.cs similarity index 98% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataAnnotationsModelValidator.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsModelValidator.cs index 563fa078a7..b70a7c4825 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataAnnotationsModelValidator.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsModelValidator.cs @@ -8,12 +8,12 @@ using System.Linq; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.Localization; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { /// /// Validates based on the given . /// - public class DataAnnotationsModelValidator : IModelValidator + internal class DataAnnotationsModelValidator : IModelValidator { private static readonly object _emptyValidationContextInstance = new object(); private readonly IStringLocalizer _stringLocalizer; diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsModelValidatorProvider.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsModelValidatorProvider.cs index b6266958c3..a0cd1c4d68 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsModelValidatorProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataAnnotationsModelValidatorProvider.cs @@ -4,7 +4,6 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataTypeAttributeAdapter.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataTypeAttributeAdapter.cs similarity index 92% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataTypeAttributeAdapter.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataTypeAttributeAdapter.cs index b9bfa16165..0c6bf4e115 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DataTypeAttributeAdapter.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DataTypeAttributeAdapter.cs @@ -6,13 +6,13 @@ using System.ComponentModel.DataAnnotations; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.Localization; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { /// /// A validation adapter that is used to map 's to a single client side validation /// rule. /// - public class DataTypeAttributeAdapter : AttributeAdapterBase + internal class DataTypeAttributeAdapter : AttributeAdapterBase { public DataTypeAttributeAdapter(DataTypeAttribute attribute, string ruleName, IStringLocalizer stringLocalizer) : base(attribute, stringLocalizer) diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DefaultClientModelValidatorProvider.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DefaultClientModelValidatorProvider.cs similarity index 91% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DefaultClientModelValidatorProvider.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/DefaultClientModelValidatorProvider.cs index 2fb0fe4769..54a533a417 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/DefaultClientModelValidatorProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DefaultClientModelValidatorProvider.cs @@ -4,7 +4,7 @@ using System; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { /// /// A default implementation of . @@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal /// The provides validators from /// instances in . /// - public class DefaultClientModelValidatorProvider : IClientModelValidatorProvider + internal class DefaultClientModelValidatorProvider : IClientModelValidatorProvider { /// public void CreateValidators(ClientValidatorProviderContext context) @@ -42,4 +42,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/MvcDataAnnotationsLocalizationConfigureCompatibilityOptions.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsLocalizationConfigureCompatibilityOptions.cs similarity index 90% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/MvcDataAnnotationsLocalizationConfigureCompatibilityOptions.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsLocalizationConfigureCompatibilityOptions.cs index e3eab734b7..eb07025356 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/MvcDataAnnotationsLocalizationConfigureCompatibilityOptions.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsLocalizationConfigureCompatibilityOptions.cs @@ -2,11 +2,13 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.DataAnnotations; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations +namespace Microsoft.Extensions.DependencyInjection { internal class MvcDataAnnotationsLocalizationConfigureCompatibilityOptions : ConfigureCompatibilityOptions { diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/MvcDataAnnotationsLocalizationOptionsSetup.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsLocalizationOptionsSetup.cs similarity index 77% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/MvcDataAnnotationsLocalizationOptionsSetup.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsLocalizationOptionsSetup.cs index e91f13b255..5410042c30 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/MvcDataAnnotationsLocalizationOptionsSetup.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsLocalizationOptionsSetup.cs @@ -2,14 +2,15 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using Microsoft.AspNetCore.Mvc.DataAnnotations; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.Extensions.DependencyInjection { /// /// Sets up default options for . /// - public class MvcDataAnnotationsLocalizationOptionsSetup : IConfigureOptions + internal class MvcDataAnnotationsLocalizationOptionsSetup : IConfigureOptions { /// public void Configure(MvcDataAnnotationsLocalizationOptions options) diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsMvcBuilderExtensions.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsMvcBuilderExtensions.cs index ddbd623b3e..8ed3212e8b 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsMvcBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsMvcBuilderExtensions.cs @@ -3,7 +3,6 @@ using System; using Microsoft.AspNetCore.Mvc.DataAnnotations; -using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal; namespace Microsoft.Extensions.DependencyInjection { diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsMvcCoreBuilderExtensions.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsMvcCoreBuilderExtensions.cs index 160a73345e..76a9ae46bb 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsMvcCoreBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsMvcCoreBuilderExtensions.cs @@ -4,7 +4,6 @@ using System; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.DataAnnotations; -using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/MvcDataAnnotationsMvcOptionsSetup.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsMvcOptionsSetup.cs similarity index 92% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/MvcDataAnnotationsMvcOptionsSetup.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsMvcOptionsSetup.cs index 1b94e5c157..f43d3cca66 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/MvcDataAnnotationsMvcOptionsSetup.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/DependencyInjection/MvcDataAnnotationsMvcOptionsSetup.cs @@ -2,15 +2,17 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.DataAnnotations; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.Extensions.DependencyInjection { /// /// Sets up default options for . /// - public class MvcDataAnnotationsMvcOptionsSetup : IConfigureOptions + internal class MvcDataAnnotationsMvcOptionsSetup : IConfigureOptions { private readonly IStringLocalizerFactory _stringLocalizerFactory; private readonly IValidationAttributeAdapterProvider _validationAttributeAdapterProvider; @@ -60,4 +62,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal _stringLocalizerFactory)); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/FileExtensionsAttributeAdapter.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/FileExtensionsAttributeAdapter.cs similarity index 93% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/FileExtensionsAttributeAdapter.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/FileExtensionsAttributeAdapter.cs index 827188f769..c7f62c67ad 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/FileExtensionsAttributeAdapter.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/FileExtensionsAttributeAdapter.cs @@ -7,9 +7,9 @@ using System.Linq; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.Localization; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { - public class FileExtensionsAttributeAdapter : AttributeAdapterBase + internal class FileExtensionsAttributeAdapter : AttributeAdapterBase { private readonly string _extensions; private readonly string _formattedExtensions; diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/MaxLengthAttributeAdapter.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/MaxLengthAttributeAdapter.cs similarity index 91% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/MaxLengthAttributeAdapter.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/MaxLengthAttributeAdapter.cs index 3a1a2cf9e9..e07e1165af 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/MaxLengthAttributeAdapter.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/MaxLengthAttributeAdapter.cs @@ -7,9 +7,9 @@ using System.Globalization; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.Localization; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { - public class MaxLengthAttributeAdapter : AttributeAdapterBase + internal class MaxLengthAttributeAdapter : AttributeAdapterBase { private readonly string _max; diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/MinLengthAttributeAdapter.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/MinLengthAttributeAdapter.cs similarity index 91% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/MinLengthAttributeAdapter.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/MinLengthAttributeAdapter.cs index 8d713b823c..488e17d59b 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/MinLengthAttributeAdapter.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/MinLengthAttributeAdapter.cs @@ -7,9 +7,9 @@ using System.Globalization; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.Localization; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { - public class MinLengthAttributeAdapter : AttributeAdapterBase + internal class MinLengthAttributeAdapter : AttributeAdapterBase { private readonly string _min; diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/NumericClientModelValidator.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/NumericClientModelValidator.cs similarity index 93% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/NumericClientModelValidator.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/NumericClientModelValidator.cs index edc0286909..f9fc45d470 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/NumericClientModelValidator.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/NumericClientModelValidator.cs @@ -6,13 +6,13 @@ using System.Collections.Generic; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { /// /// An implementation of that provides the rule for validating /// numeric types. /// - public class NumericClientModelValidator : IClientModelValidator + internal class NumericClientModelValidator : IClientModelValidator { /// public void AddValidation(ClientModelValidationContext context) diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/NumericClientModelValidatorProvider.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/NumericClientModelValidatorProvider.cs similarity index 91% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/NumericClientModelValidatorProvider.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/NumericClientModelValidatorProvider.cs index a2e182d381..20c1cf086a 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/NumericClientModelValidatorProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/NumericClientModelValidatorProvider.cs @@ -4,13 +4,13 @@ using System; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { /// /// An implementation of which provides client validators /// for specific numeric types. /// - public class NumericClientModelValidatorProvider : IClientModelValidatorProvider + internal class NumericClientModelValidatorProvider : IClientModelValidatorProvider { /// public void CreateValidators(ClientValidatorProviderContext context) diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Properties/AssemblyInfo.cs index a0584f4754..06956dcef0 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Properties/AssemblyInfo.cs @@ -3,10 +3,13 @@ using System.Runtime.CompilerServices; +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.ViewFeatures, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] + [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.DataAnnotations.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Core.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Core.TestCommon, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.IntegrationTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.ViewFeatures.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Performance, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/RangeAttributeAdapter.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/RangeAttributeAdapter.cs similarity index 93% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/RangeAttributeAdapter.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/RangeAttributeAdapter.cs index 345e6cc3b9..692dc900d0 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/RangeAttributeAdapter.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/RangeAttributeAdapter.cs @@ -7,9 +7,9 @@ using System.Globalization; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.Localization; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { - public class RangeAttributeAdapter : AttributeAdapterBase + internal class RangeAttributeAdapter : AttributeAdapterBase { private readonly string _max; private readonly string _min; @@ -56,4 +56,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal Attribute.Maximum); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/RegularExpressionAttributeAdapter.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/RegularExpressionAttributeAdapter.cs similarity index 90% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/RegularExpressionAttributeAdapter.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/RegularExpressionAttributeAdapter.cs index 552c5dcad2..d0278580cc 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/RegularExpressionAttributeAdapter.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/RegularExpressionAttributeAdapter.cs @@ -6,9 +6,9 @@ using System.ComponentModel.DataAnnotations; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.Localization; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { - public class RegularExpressionAttributeAdapter : AttributeAdapterBase + internal class RegularExpressionAttributeAdapter : AttributeAdapterBase { public RegularExpressionAttributeAdapter(RegularExpressionAttribute attribute, IStringLocalizer stringLocalizer) : base(attribute, stringLocalizer) diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/RequiredAttributeAdapter.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/RequiredAttributeAdapter.cs similarity index 90% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/RequiredAttributeAdapter.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/RequiredAttributeAdapter.cs index 90e33ab49e..e4f824ae30 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/RequiredAttributeAdapter.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/RequiredAttributeAdapter.cs @@ -6,9 +6,9 @@ using System.ComponentModel.DataAnnotations; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.Localization; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { - public class RequiredAttributeAdapter : AttributeAdapterBase + internal class RequiredAttributeAdapter : AttributeAdapterBase { public RequiredAttributeAdapter(RequiredAttribute attribute, IStringLocalizer stringLocalizer) : base(attribute, stringLocalizer) @@ -37,4 +37,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal return GetErrorMessage(validationContext.ModelMetadata, validationContext.ModelMetadata.GetDisplayName()); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/StringLengthAttributeAdapter.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/StringLengthAttributeAdapter.cs similarity index 93% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/StringLengthAttributeAdapter.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/StringLengthAttributeAdapter.cs index f733d4470a..e1df7efab2 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/StringLengthAttributeAdapter.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/StringLengthAttributeAdapter.cs @@ -7,9 +7,9 @@ using System.Globalization; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; using Microsoft.Extensions.Localization; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { - public class StringLengthAttributeAdapter : AttributeAdapterBase + internal class StringLengthAttributeAdapter : AttributeAdapterBase { private readonly string _max; private readonly string _min; diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/ValidatableObjectAdapter.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/ValidatableObjectAdapter.cs similarity index 95% rename from src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/ValidatableObjectAdapter.cs rename to src/Microsoft.AspNetCore.Mvc.DataAnnotations/ValidatableObjectAdapter.cs index 55a9ca23a1..022e637fb8 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/Internal/ValidatableObjectAdapter.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/ValidatableObjectAdapter.cs @@ -7,9 +7,9 @@ using System.ComponentModel.DataAnnotations; using System.Linq; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal +namespace Microsoft.AspNetCore.Mvc.DataAnnotations { - public class ValidatableObjectAdapter : IModelValidator + internal class ValidatableObjectAdapter : IModelValidator { public IEnumerable Validate(ModelValidationContext context) { diff --git a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/ValidationAttributeAdapterProvider.cs b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/ValidationAttributeAdapterProvider.cs index a16b405a5f..7ec543d39d 100644 --- a/src/Microsoft.AspNetCore.Mvc.DataAnnotations/ValidationAttributeAdapterProvider.cs +++ b/src/Microsoft.AspNetCore.Mvc.DataAnnotations/ValidationAttributeAdapterProvider.cs @@ -3,7 +3,6 @@ using System; using System.ComponentModel.DataAnnotations; -using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal; using Microsoft.Extensions.Localization; namespace Microsoft.AspNetCore.Mvc.DataAnnotations diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/DependencyInjection/MvcJsonMvcCoreBuilderExtensions.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/DependencyInjection/MvcJsonMvcCoreBuilderExtensions.cs index accd9045eb..7314bb1df9 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/DependencyInjection/MvcJsonMvcCoreBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/DependencyInjection/MvcJsonMvcCoreBuilderExtensions.cs @@ -4,8 +4,8 @@ using System; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Formatters.Json; -using Microsoft.AspNetCore.Mvc.Formatters.Json.Internal; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; using Newtonsoft.Json; diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/MvcJsonMvcOptionsSetup.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/DependencyInjection/MvcJsonMvcOptionsSetup.cs similarity index 94% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/MvcJsonMvcOptionsSetup.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Json/DependencyInjection/MvcJsonMvcOptionsSetup.cs index 33f2b51eac..bc2f044e92 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/MvcJsonMvcOptionsSetup.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/DependencyInjection/MvcJsonMvcOptionsSetup.cs @@ -4,19 +4,20 @@ using System; using System.Buffers; using Microsoft.AspNetCore.JsonPatch; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.Extensions.Logging; using Microsoft.Extensions.ObjectPool; using Microsoft.Extensions.Options; -using Microsoft.Net.Http.Headers; using Newtonsoft.Json.Linq; -namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal +namespace Microsoft.Extensions.DependencyInjection { /// /// Sets up JSON formatter options for . /// - public class MvcJsonMvcOptionsSetup : IConfigureOptions + internal class MvcJsonMvcOptionsSetup : IConfigureOptions { private readonly ILoggerFactory _loggerFactory; private readonly MvcJsonOptions _jsonOptions; diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/MvcJsonOptionsConfigureCompatibilityOptions.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/DependencyInjection/MvcJsonOptionsConfigureCompatibilityOptions.cs similarity index 93% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Json/MvcJsonOptionsConfigureCompatibilityOptions.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Json/DependencyInjection/MvcJsonOptionsConfigureCompatibilityOptions.cs index f33e6dc108..5fe4836b37 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/MvcJsonOptionsConfigureCompatibilityOptions.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/DependencyInjection/MvcJsonOptionsConfigureCompatibilityOptions.cs @@ -2,11 +2,12 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Mvc +namespace Microsoft.Extensions.DependencyInjection { internal class MvcJsonOptionsConfigureCompatibilityOptions : ConfigureCompatibilityOptions { diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/MvcJsonOptionsExtensions.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/DependencyInjection/MvcJsonOptionsExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Json/MvcJsonOptionsExtensions.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Json/DependencyInjection/MvcJsonOptionsExtensions.cs diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/JsonArrayPool.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonArrayPool.cs similarity index 88% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/JsonArrayPool.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonArrayPool.cs index 437f9bcf98..773dc82693 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/JsonArrayPool.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonArrayPool.cs @@ -5,9 +5,9 @@ using System; using System.Buffers; using Newtonsoft.Json; -namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal +namespace Microsoft.AspNetCore.Mvc.Formatters { - public class JsonArrayPool : IArrayPool + internal class JsonArrayPool : IArrayPool { private readonly ArrayPool _inner; diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonInputFormatter.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonInputFormatter.cs index cc21792d71..b217ce441e 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonInputFormatter.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonInputFormatter.cs @@ -10,7 +10,6 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc.Formatters.Json.Internal; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.WebUtilities; using Microsoft.Extensions.Logging; diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonOutputFormatter.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonOutputFormatter.cs index 744d558680..7dafe6fe94 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonOutputFormatter.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonOutputFormatter.cs @@ -7,7 +7,6 @@ using System.ComponentModel; using System.IO; using System.Text; using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Formatters.Json.Internal; using Newtonsoft.Json; namespace Microsoft.AspNetCore.Mvc.Formatters diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonPatchInputFormatter.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonPatchInputFormatter.cs index 96549d44d5..9fd0a364b3 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonPatchInputFormatter.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonPatchInputFormatter.cs @@ -7,7 +7,6 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; using Microsoft.AspNetCore.JsonPatch; -using Microsoft.AspNetCore.Mvc.Formatters.Json.Internal; using Microsoft.Extensions.Logging; using Microsoft.Extensions.ObjectPool; using Newtonsoft.Json; diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonResult.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonResult.cs index a4a576a83f..5abad92bff 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonResult.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonResult.cs @@ -3,7 +3,7 @@ using System; using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Formatters.Json.Internal; +using Microsoft.AspNetCore.Mvc.Formatters; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.Extensions.DependencyInjection; using Newtonsoft.Json; diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/JsonResultExecutor.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonResultExecutor.cs similarity index 81% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/JsonResultExecutor.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonResultExecutor.cs index 7a0eae64e2..81f0f783d7 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/JsonResultExecutor.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonResultExecutor.cs @@ -11,18 +11,21 @@ using Microsoft.Extensions.Options; using Microsoft.Net.Http.Headers; using Newtonsoft.Json; -namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal +namespace Microsoft.AspNetCore.Mvc.Formatters { /// /// Executes a to write to the response. /// - public class JsonResultExecutor + internal class JsonResultExecutor { private static readonly string DefaultContentType = new MediaTypeHeaderValue("application/json") { Encoding = Encoding.UTF8 }.ToString(); + private readonly IHttpResponseStreamWriterFactory _writerFactory; + private readonly ILogger _logger; + private readonly MvcJsonOptions _options; private readonly IArrayPool _charPool; /// @@ -58,34 +61,19 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal throw new ArgumentNullException(nameof(charPool)); } - WriterFactory = writerFactory; - Logger = logger; - Options = options.Value; + _writerFactory = writerFactory; + _logger = logger; + _options = options.Value; _charPool = new JsonArrayPool(charPool); } - /// - /// Gets the . - /// - protected ILogger Logger { get; } - - /// - /// Gets the . - /// - protected MvcJsonOptions Options { get; } - - /// - /// Gets the . - /// - protected IHttpResponseStreamWriterFactory WriterFactory { get; } - /// /// Executes the and writes the response. /// /// The . /// The . /// A which will complete when writing has completed. - public virtual async Task ExecuteAsync(ActionContext context, JsonResult result) + public async Task ExecuteAsync(ActionContext context, JsonResult result) { if (context == null) { @@ -113,10 +101,10 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal response.StatusCode = result.StatusCode.Value; } - var serializerSettings = result.SerializerSettings ?? Options.SerializerSettings; + var serializerSettings = result.SerializerSettings ?? _options.SerializerSettings; - Logger.JsonResultExecuting(result.Value); - using (var writer = WriterFactory.CreateWriter(response.Body, resolvedContentTypeEncoding)) + _logger.JsonResultExecuting(result.Value); + using (var writer = _writerFactory.CreateWriter(response.Body, resolvedContentTypeEncoding)) { using (var jsonWriter = new JsonTextWriter(writer)) { diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/JsonSerializerObjectPolicy.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonSerializerObjectPolicy.cs similarity index 88% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/JsonSerializerObjectPolicy.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonSerializerObjectPolicy.cs index 5cd0a0e3d6..4efc81abcc 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/JsonSerializerObjectPolicy.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/JsonSerializerObjectPolicy.cs @@ -4,12 +4,12 @@ using Microsoft.Extensions.ObjectPool; using Newtonsoft.Json; -namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal +namespace Microsoft.AspNetCore.Mvc.Formatters { /// /// for . /// - public class JsonSerializerObjectPolicy : IPooledObjectPolicy + internal class JsonSerializerObjectPolicy : IPooledObjectPolicy { private readonly JsonSerializerSettings _serializerSettings; diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/MediaTypeHeaderValues.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/MediaTypeHeaderValues.cs similarity index 89% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/MediaTypeHeaderValues.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Json/MediaTypeHeaderValues.cs index d9fb986507..ec791b15ef 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/MediaTypeHeaderValues.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/MediaTypeHeaderValues.cs @@ -3,9 +3,9 @@ using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal +namespace Microsoft.AspNetCore.Mvc.Formatters { - internal class MediaTypeHeaderValues + internal static class MediaTypeHeaderValues { public static readonly MediaTypeHeaderValue ApplicationJson = MediaTypeHeaderValue.Parse("application/json").CopyAsReadOnly(); diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/MvcJsonLoggerExtensions.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/MvcJsonLoggerExtensions.cs similarity index 95% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/MvcJsonLoggerExtensions.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Json/MvcJsonLoggerExtensions.cs index c06d819865..c4f15f190a 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Internal/MvcJsonLoggerExtensions.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/MvcJsonLoggerExtensions.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal +namespace Microsoft.AspNetCore.Mvc.Formatters { internal static class MvcJsonLoggerExtensions { diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Properties/AssemblyInfo.cs index 7982959233..a6552b389c 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Properties/AssemblyInfo.cs @@ -3,4 +3,6 @@ using System.Runtime.CompilerServices; +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Formatters.Json.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.IntegrationTests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/MvcXmlOptionsConfigureCompatibilityOptions.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/DependencyInjection/MvcXmlOptionsConfigureCompatibilityOptions.cs similarity index 93% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Xml/MvcXmlOptionsConfigureCompatibilityOptions.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Xml/DependencyInjection/MvcXmlOptionsConfigureCompatibilityOptions.cs index c5d1d3e340..d37e67d3e1 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/MvcXmlOptionsConfigureCompatibilityOptions.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/DependencyInjection/MvcXmlOptionsConfigureCompatibilityOptions.cs @@ -2,12 +2,13 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Formatters.Xml; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Mvc +namespace Microsoft.Extensions.DependencyInjection { internal sealed class MvcXmlOptionsConfigureCompatibilityOptions : ConfigureCompatibilityOptions { diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlDataContractSerializerMvcOptionsSetup.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/DependencyInjection/XmlDataContractSerializerMvcOptionsSetup.cs similarity index 94% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlDataContractSerializerMvcOptionsSetup.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Xml/DependencyInjection/XmlDataContractSerializerMvcOptionsSetup.cs index eba6b9d5fd..83a8fd5b67 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlDataContractSerializerMvcOptionsSetup.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/DependencyInjection/XmlDataContractSerializerMvcOptionsSetup.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Xml; -using System.Xml.Linq; -using Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Formatters; +using Microsoft.AspNetCore.Mvc.Formatters.Xml; using Microsoft.AspNetCore.Mvc.ModelBinding; using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Mvc.Formatters.Xml +namespace Microsoft.Extensions.DependencyInjection { /// /// A implementation which will add the diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlSerializerMvcOptionsSetup.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/DependencyInjection/XmlSerializerMvcOptionsSetup.cs similarity index 93% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlSerializerMvcOptionsSetup.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Xml/DependencyInjection/XmlSerializerMvcOptionsSetup.cs index 1a57d167ce..3186fab390 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlSerializerMvcOptionsSetup.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/DependencyInjection/XmlSerializerMvcOptionsSetup.cs @@ -2,11 +2,13 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Formatters; +using Microsoft.AspNetCore.Mvc.Formatters.Xml; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Mvc.Formatters.Xml +namespace Microsoft.Extensions.DependencyInjection { /// /// A implementation which will add the diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/Internal/FormattingUtilities.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/FormattingUtilities.cs similarity index 93% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Xml/Internal/FormattingUtilities.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Xml/FormattingUtilities.cs index 7b97d7ca79..70a9c94453 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/Internal/FormattingUtilities.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/FormattingUtilities.cs @@ -4,12 +4,12 @@ using System.Runtime.Serialization; using System.Xml; -namespace Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal +namespace Microsoft.AspNetCore.Mvc.Formatters.Xml { /// /// Contains methods which are used by Xml input formatters. /// - public static class FormattingUtilities + internal static class FormattingUtilities { public static readonly int DefaultMaxDepth = 32; public static readonly XsdDataContractExporter XsdDataContractExporter = new XsdDataContractExporter(); diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/LoggerExtensions.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/LoggerExtensions.cs index dfb00627d4..76496bea3a 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/LoggerExtensions.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/LoggerExtensions.cs @@ -4,9 +4,9 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal +namespace Microsoft.AspNetCore.Mvc.Formatters.Xml { - public static class LoggerExtensions + internal static class LoggerExtensions { private static readonly Action _failedToCreateXmlSerializer; private static readonly Action _failedToCreateDataContractSerializer; diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/Internal/MediaTypeHeaderValues.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/MediaTypeHeaderValues.cs similarity index 92% rename from src/Microsoft.AspNetCore.Mvc.Formatters.Xml/Internal/MediaTypeHeaderValues.cs rename to src/Microsoft.AspNetCore.Mvc.Formatters.Xml/MediaTypeHeaderValues.cs index 14f2a99ce4..24ddce0b3f 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/Internal/MediaTypeHeaderValues.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/MediaTypeHeaderValues.cs @@ -3,7 +3,7 @@ using Microsoft.Net.Http.Headers; -namespace Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal +namespace Microsoft.AspNetCore.Mvc.Formatters.Xml { internal static class MediaTypeHeaderValues { diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlDataContractSerializerInputFormatter.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlDataContractSerializerInputFormatter.cs index b3c6e52b2b..ac1b2a085e 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlDataContractSerializerInputFormatter.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlDataContractSerializerInputFormatter.cs @@ -13,7 +13,6 @@ using System.Threading.Tasks; using System.Xml; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Formatters.Xml; -using Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.WebUtilities; diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlDataContractSerializerOutputFormatter.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlDataContractSerializerOutputFormatter.cs index 9b89042636..c0a9cdab2d 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlDataContractSerializerOutputFormatter.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlDataContractSerializerOutputFormatter.cs @@ -10,7 +10,6 @@ using System.Text; using System.Threading.Tasks; using System.Xml; using Microsoft.AspNetCore.Mvc.Formatters.Xml; -using Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.Mvc.Formatters diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlSerializerInputFormatter.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlSerializerInputFormatter.cs index 77f37c740c..729d9e1117 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlSerializerInputFormatter.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlSerializerInputFormatter.cs @@ -13,7 +13,6 @@ using System.Xml; using System.Xml.Serialization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Formatters.Xml; -using Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal; using Microsoft.AspNetCore.Mvc.Infrastructure; using Microsoft.AspNetCore.WebUtilities; diff --git a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlSerializerOutputFormatter.cs b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlSerializerOutputFormatter.cs index c289972ea4..9960eedbd6 100644 --- a/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlSerializerOutputFormatter.cs +++ b/src/Microsoft.AspNetCore.Mvc.Formatters.Xml/XmlSerializerOutputFormatter.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; using System.Xml; using System.Xml.Serialization; using Microsoft.AspNetCore.Mvc.Formatters.Xml; -using Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal; using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.Mvc.Formatters diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/AttributeMatcher.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/AttributeMatcher.cs similarity index 90% rename from src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/AttributeMatcher.cs rename to src/Microsoft.AspNetCore.Mvc.TagHelpers/AttributeMatcher.cs index 5caa08dc5b..309f2aa574 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/AttributeMatcher.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/AttributeMatcher.cs @@ -5,12 +5,12 @@ using System; using System.Collections.Generic; using Microsoft.AspNetCore.Razor.TagHelpers; -namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal +namespace Microsoft.AspNetCore.Mvc.TagHelpers { /// /// Methods for determining how an should run based on the attributes that were specified. /// - public static class AttributeMatcher + internal static class AttributeMatcher { /// /// Determines the most effective mode a can run in based on which modes have @@ -73,15 +73,13 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal // Perf: Avoid allocating enumerator for (var i = 0; i < requiredAttributes.Length; i++) { - TagHelperAttribute attribute; - if (!context.AllAttributes.TryGetAttribute(requiredAttributes[i], out attribute)) + if (!context.AllAttributes.TryGetAttribute(requiredAttributes[i], out var attribute)) { // Missing attribute. return true; } - var valueAsString = attribute.Value as string; - if (valueAsString != null && string.IsNullOrEmpty(valueAsString)) + if (attribute.Value is string valueAsString && string.IsNullOrEmpty(valueAsString)) { // Treat attributes with empty values as missing. return true; @@ -91,4 +89,4 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal return false; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Cache/DistributedCacheTagHelperService.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/Cache/DistributedCacheTagHelperService.cs index 7db418f9b4..88c4e0332c 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Cache/DistributedCacheTagHelperService.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/Cache/DistributedCacheTagHelperService.cs @@ -9,7 +9,6 @@ using System.Text; using System.Text.Encodings.Web; using System.Threading.Tasks; using Microsoft.AspNetCore.Html; -using Microsoft.AspNetCore.Mvc.TagHelpers.Internal; using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Logging; @@ -80,10 +79,8 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Cache while (content == null) { - Task result; - // Is there any request already processing the value? - if (!_workers.TryGetValue(key, out result)) + if (!_workers.TryGetValue(key, out var result)) { // There is a small race condition here between TryGetValue and TryAdd that might cause the // content to be computed more than once. We don't care about this race as the probability of diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/CacheTagHelper.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/CacheTagHelper.cs index 72d106ce91..a097528945 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/CacheTagHelper.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/CacheTagHelper.cs @@ -10,7 +10,6 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Html; using Microsoft.AspNetCore.Mvc.TagHelpers.Cache; -using Microsoft.AspNetCore.Mvc.TagHelpers.Internal; using Microsoft.AspNetCore.Mvc.ViewFeatures.Buffers; using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.Extensions.Caching.Memory; @@ -44,9 +43,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers /// used by the . /// The to use. public CacheTagHelper( -#pragma warning disable PUB0001 // Pubternal type in public API CacheTagHelperMemoryCacheFactory factory, -#pragma warning restore PUB0001 HtmlEncoder htmlEncoder) : base(htmlEncoder) { diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/CacheTagHelperMemoryCacheFactory.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/CacheTagHelperMemoryCacheFactory.cs similarity index 93% rename from src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/CacheTagHelperMemoryCacheFactory.cs rename to src/Microsoft.AspNetCore.Mvc.TagHelpers/CacheTagHelperMemoryCacheFactory.cs index 7239f80260..6b1ac41fb8 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/CacheTagHelperMemoryCacheFactory.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/CacheTagHelperMemoryCacheFactory.cs @@ -4,7 +4,7 @@ using Microsoft.Extensions.Caching.Memory; using Microsoft.Extensions.Options; -namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal +namespace Microsoft.AspNetCore.Mvc.TagHelpers { public class CacheTagHelperMemoryCacheFactory { diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/CurrentValues.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/CurrentValues.cs similarity index 85% rename from src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/CurrentValues.cs rename to src/Microsoft.AspNetCore.Mvc.TagHelpers/CurrentValues.cs index 6126d91507..8794df7203 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/CurrentValues.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/CurrentValues.cs @@ -4,9 +4,9 @@ using System.Collections.Generic; using System.Diagnostics; -namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal +namespace Microsoft.AspNetCore.Mvc.TagHelpers { - public class CurrentValues + internal class CurrentValues { public CurrentValues(ICollection values) { diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/DependencyInjection/TagHelperExtensions.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/DependencyInjection/TagHelperExtensions.cs index 5161244492..e39242536a 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/DependencyInjection/TagHelperExtensions.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/DependencyInjection/TagHelperExtensions.cs @@ -4,7 +4,6 @@ using System; using Microsoft.AspNetCore.Mvc.TagHelpers; using Microsoft.AspNetCore.Mvc.TagHelpers.Cache; -using Microsoft.AspNetCore.Mvc.TagHelpers.Internal; using Microsoft.Extensions.DependencyInjection.Extensions; namespace Microsoft.Extensions.DependencyInjection diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/FileProviderGlobbingDirectory.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/FileProviderGlobbingDirectory.cs similarity index 96% rename from src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/FileProviderGlobbingDirectory.cs rename to src/Microsoft.AspNetCore.Mvc.TagHelpers/FileProviderGlobbingDirectory.cs index c2d0bf6227..5cb63e410f 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/FileProviderGlobbingDirectory.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/FileProviderGlobbingDirectory.cs @@ -6,9 +6,9 @@ using System.Collections.Generic; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.FileSystemGlobbing.Abstractions; -namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal +namespace Microsoft.AspNetCore.Mvc.TagHelpers { - public class FileProviderGlobbingDirectory : DirectoryInfoBase + internal class FileProviderGlobbingDirectory : DirectoryInfoBase { private const char DirectorySeparatorChar = '/'; private readonly IFileProvider _fileProvider; @@ -96,4 +96,4 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal return new FileProviderGlobbingFile(fileInfo, this); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/FileProviderGlobbingFile.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/FileProviderGlobbingFile.cs similarity index 90% rename from src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/FileProviderGlobbingFile.cs rename to src/Microsoft.AspNetCore.Mvc.TagHelpers/FileProviderGlobbingFile.cs index 2696781c8c..67ccc9e046 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/FileProviderGlobbingFile.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/FileProviderGlobbingFile.cs @@ -5,9 +5,9 @@ using System; using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.FileSystemGlobbing.Abstractions; -namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal +namespace Microsoft.AspNetCore.Mvc.TagHelpers { - public class FileProviderGlobbingFile : FileInfoBase + internal class FileProviderGlobbingFile : FileInfoBase { private const char DirectorySeparatorChar = '/'; @@ -34,4 +34,4 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal public override DirectoryInfoBase ParentDirectory { get; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/GlobbingUrlBuilder.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/GlobbingUrlBuilder.cs similarity index 99% rename from src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/GlobbingUrlBuilder.cs rename to src/Microsoft.AspNetCore.Mvc.TagHelpers/GlobbingUrlBuilder.cs index ce891ad84e..82c176bc8b 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/GlobbingUrlBuilder.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/GlobbingUrlBuilder.cs @@ -10,7 +10,7 @@ using Microsoft.Extensions.FileSystemGlobbing; using Microsoft.Extensions.Internal; using Microsoft.Extensions.Primitives; -namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal +namespace Microsoft.AspNetCore.Mvc.TagHelpers { /// /// Utility methods for 's that support @@ -381,4 +381,4 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/JavaScriptResources.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/JavaScriptResources.cs similarity index 95% rename from src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/JavaScriptResources.cs rename to src/Microsoft.AspNetCore.Mvc.TagHelpers/JavaScriptResources.cs index ad0bdf93a4..394d9de910 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/JavaScriptResources.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/JavaScriptResources.cs @@ -7,12 +7,12 @@ using System.Diagnostics; using System.IO; using System.Reflection; -namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal +namespace Microsoft.AspNetCore.Mvc.TagHelpers { /// /// Methods for loading JavaScript from assembly embedded resources. /// - public static class JavaScriptResources + internal static class JavaScriptResources { private static readonly Assembly ResourcesAssembly = typeof(JavaScriptResources).GetTypeInfo().Assembly; @@ -58,4 +58,4 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal return input.Substring(0, input.Length - 2); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/LinkTagHelper.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/LinkTagHelper.cs index d082db1ef6..34d4ef1fa1 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/LinkTagHelper.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/LinkTagHelper.cs @@ -12,7 +12,6 @@ using Microsoft.AspNetCore.Html; using Microsoft.AspNetCore.Mvc.Razor.Infrastructure; using Microsoft.AspNetCore.Mvc.Razor.TagHelpers; using Microsoft.AspNetCore.Mvc.Routing; -using Microsoft.AspNetCore.Mvc.TagHelpers.Internal; using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Razor.TagHelpers; using Microsoft.Extensions.Caching.Memory; @@ -241,9 +240,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers protected JavaScriptEncoder JavaScriptEncoder { get; } // Internal for ease of use when testing. -#pragma warning disable PUB0001 // Pubternal type in public API protected internal GlobbingUrlBuilder GlobbingUrlBuilder { get; set; } -#pragma warning restore PUB0001 internal IFileVersionProvider FileVersionProvider { get; private set; } diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/ModeAttributesOfT.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/ModeAttributesOfT.cs similarity index 92% rename from src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/ModeAttributesOfT.cs rename to src/Microsoft.AspNetCore.Mvc.TagHelpers/ModeAttributesOfT.cs index d5079b7d46..6aafc88d8f 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/ModeAttributesOfT.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/ModeAttributesOfT.cs @@ -1,13 +1,13 @@ // 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. -namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal +namespace Microsoft.AspNetCore.Mvc.TagHelpers { /// /// A mapping of a mode to its required attributes. /// /// The type representing the 's mode. - public class ModeAttributes + internal class ModeAttributes { /// /// Initializes a new instance of . diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/MvcTagHelpersLoggerExtensions.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/MvcTagHelpersLoggerExtensions.cs similarity index 94% rename from src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/MvcTagHelpersLoggerExtensions.cs rename to src/Microsoft.AspNetCore.Mvc.TagHelpers/MvcTagHelpersLoggerExtensions.cs index 1943e1bcb8..7a78c67530 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/Internal/MvcTagHelpersLoggerExtensions.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/MvcTagHelpersLoggerExtensions.cs @@ -4,7 +4,7 @@ using System; using Microsoft.Extensions.Logging; -namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal +namespace Microsoft.AspNetCore.Mvc.TagHelpers { internal static class MvcTagHelperLoggerExtensions { diff --git a/src/Microsoft.AspNetCore.Mvc.TagHelpers/OptionTagHelper.cs b/src/Microsoft.AspNetCore.Mvc.TagHelpers/OptionTagHelper.cs index 8f2678e968..3cfaf3bb4c 100644 --- a/src/Microsoft.AspNetCore.Mvc.TagHelpers/OptionTagHelper.cs +++ b/src/Microsoft.AspNetCore.Mvc.TagHelpers/OptionTagHelper.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.AspNetCore.Mvc.TagHelpers.Internal; using Microsoft.AspNetCore.Mvc.ViewFeatures; using Microsoft.AspNetCore.Razor.TagHelpers; @@ -76,8 +75,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers if (!output.Attributes.ContainsName("selected")) { // Is this