Move pubinternal to internal in CORS, DataAnnotations, Formatters, TagHelpers

This commit is contained in:
Pranav K 2018-11-09 13:16:11 -08:00
parent fcf5593813
commit 195a22d92c
149 changed files with 262 additions and 290 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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
{
/// <summary>
/// A filter factory which creates a new instance of <see cref="CorsAuthorizationFilter"/>.
/// </summary>
public class CorsAuthorizationFilterFactory : IFilterFactory, IOrderedFilter
internal class CorsAuthorizationFilterFactory : IFilterFactory, IOrderedFilter
{
private readonly string _policyName;

View File

@ -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<ILogger, Type, Exception> _notMostEffectiveFilter;

View File

@ -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

View File

@ -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
{
/// <summary>
/// An <see cref="ICorsAuthorizationFilter"/> which ensures that an action does not run for a pre-flight request.
/// </summary>
public class DisableCorsAuthorizationFilter : ICorsAuthorizationFilter
internal class DisableCorsAuthorizationFilter : ICorsAuthorizationFilter
{
/// <inheritdoc />
// Since clients' preflight requests would not have data to authenticate requests, this

View File

@ -3,12 +3,12 @@
using Microsoft.AspNetCore.Mvc.Filters;
namespace Microsoft.AspNetCore.Mvc.Cors.Internal
namespace Microsoft.AspNetCore.Mvc.Cors
{
/// <summary>
/// A filter that can be used to enable/disable CORS support for a resource.
/// </summary>
public interface ICorsAuthorizationFilter : IAsyncAuthorizationFilter, IOrderedFilter
internal interface ICorsAuthorizationFilter : IAsyncAuthorizationFilter, IOrderedFilter
{
}
}

View File

@ -0,0 +1,6 @@
[
{
"TypeId": "public class Microsoft.AspNetCore.Mvc.Cors.CorsAuthorizationFilter : Microsoft.AspNetCore.Mvc.Cors.Internal.ICorsAuthorizationFilter",
"Kind": "Removal"
}
]

View File

@ -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<CompareAttribute>
internal class CompareAttributeAdapter : AttributeAdapterBase<CompareAttribute>
{
private readonly string _otherProperty;
@ -105,4 +105,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
}
}
}
}
}

View File

@ -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
{
/// <summary>
/// An implementation of <see cref="IClientModelValidatorProvider"/> which provides client validators
@ -16,7 +16,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
/// The logic to support <see cref="IClientModelValidator"/>
/// is implemented in <see cref="ValidationAttributeAdapter{TAttribute}"/>.
/// </summary>
public class DataAnnotationsClientModelValidatorProvider : IClientModelValidatorProvider
internal class DataAnnotationsClientModelValidatorProvider : IClientModelValidatorProvider
{
private readonly IOptions<MvcDataAnnotationsLocalizationOptions> _options;
private readonly IStringLocalizerFactory _stringLocalizerFactory;

View File

@ -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,

View File

@ -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
{
/// <summary>
/// An implementation of <see cref="IBindingMetadataProvider"/> and <see cref="IDisplayMetadataProvider"/> for
/// the System.ComponentModel.DataAnnotations attribute classes.
/// </summary>
public class DataAnnotationsMetadataProvider :
internal class DataAnnotationsMetadataProvider :
IBindingMetadataProvider,
IDisplayMetadataProvider,
IValidationMetadataProvider
@ -388,4 +388,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
return string.Empty;
}
}
}
}

View File

@ -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
{
/// <summary>
/// Validates based on the given <see cref="ValidationAttribute"/>.
/// </summary>
public class DataAnnotationsModelValidator : IModelValidator
internal class DataAnnotationsModelValidator : IModelValidator
{
private static readonly object _emptyValidationContextInstance = new object();
private readonly IStringLocalizer _stringLocalizer;

View File

@ -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;

View File

@ -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
{
/// <summary>
/// A validation adapter that is used to map <see cref="DataTypeAttribute"/>'s to a single client side validation
/// rule.
/// </summary>
public class DataTypeAttributeAdapter : AttributeAdapterBase<DataTypeAttribute>
internal class DataTypeAttributeAdapter : AttributeAdapterBase<DataTypeAttribute>
{
public DataTypeAttributeAdapter(DataTypeAttribute attribute, string ruleName, IStringLocalizer stringLocalizer)
: base(attribute, stringLocalizer)

View File

@ -4,7 +4,7 @@
using System;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
{
/// <summary>
/// A default implementation of <see cref="IClientModelValidatorProvider"/>.
@ -13,7 +13,7 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
/// The <see cref="DefaultClientModelValidatorProvider"/> provides validators from
/// <see cref="IClientModelValidator"/> instances in <see cref="ModelBinding.ModelMetadata.ValidatorMetadata"/>.
/// </remarks>
public class DefaultClientModelValidatorProvider : IClientModelValidatorProvider
internal class DefaultClientModelValidatorProvider : IClientModelValidatorProvider
{
/// <inheritdoc />
public void CreateValidators(ClientValidatorProviderContext context)
@ -42,4 +42,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
}
}
}
}
}

View File

@ -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<MvcDataAnnotationsLocalizationOptions>
{

View File

@ -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
{
/// <summary>
/// Sets up default options for <see cref="MvcDataAnnotationsLocalizationOptions"/>.
/// </summary>
public class MvcDataAnnotationsLocalizationOptionsSetup : IConfigureOptions<MvcDataAnnotationsLocalizationOptions>
internal class MvcDataAnnotationsLocalizationOptionsSetup : IConfigureOptions<MvcDataAnnotationsLocalizationOptions>
{
/// <inheritdoc />
public void Configure(MvcDataAnnotationsLocalizationOptions options)

View File

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

View File

@ -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;

View File

@ -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
{
/// <summary>
/// Sets up default options for <see cref="MvcOptions"/>.
/// </summary>
public class MvcDataAnnotationsMvcOptionsSetup : IConfigureOptions<MvcOptions>
internal class MvcDataAnnotationsMvcOptionsSetup : IConfigureOptions<MvcOptions>
{
private readonly IStringLocalizerFactory _stringLocalizerFactory;
private readonly IValidationAttributeAdapterProvider _validationAttributeAdapterProvider;
@ -60,4 +62,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
_stringLocalizerFactory));
}
}
}
}

View File

@ -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<FileExtensionsAttribute>
internal class FileExtensionsAttributeAdapter : AttributeAdapterBase<FileExtensionsAttribute>
{
private readonly string _extensions;
private readonly string _formattedExtensions;

View File

@ -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<MaxLengthAttribute>
internal class MaxLengthAttributeAdapter : AttributeAdapterBase<MaxLengthAttribute>
{
private readonly string _max;

View File

@ -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<MinLengthAttribute>
internal class MinLengthAttributeAdapter : AttributeAdapterBase<MinLengthAttribute>
{
private readonly string _min;

View File

@ -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
{
/// <summary>
/// An implementation of <see cref="IClientModelValidator"/> that provides the rule for validating
/// numeric types.
/// </summary>
public class NumericClientModelValidator : IClientModelValidator
internal class NumericClientModelValidator : IClientModelValidator
{
/// <inheritdoc />
public void AddValidation(ClientModelValidationContext context)

View File

@ -4,13 +4,13 @@
using System;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
{
/// <summary>
/// An implementation of <see cref="IClientModelValidatorProvider"/> which provides client validators
/// for specific numeric types.
/// </summary>
public class NumericClientModelValidatorProvider : IClientModelValidatorProvider
internal class NumericClientModelValidatorProvider : IClientModelValidatorProvider
{
/// <inheritdoc />
public void CreateValidators(ClientValidatorProviderContext context)

View File

@ -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")]

View File

@ -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<RangeAttribute>
internal class RangeAttributeAdapter : AttributeAdapterBase<RangeAttribute>
{
private readonly string _max;
private readonly string _min;
@ -56,4 +56,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
Attribute.Maximum);
}
}
}
}

View File

@ -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<RegularExpressionAttribute>
internal class RegularExpressionAttributeAdapter : AttributeAdapterBase<RegularExpressionAttribute>
{
public RegularExpressionAttributeAdapter(RegularExpressionAttribute attribute, IStringLocalizer stringLocalizer)
: base(attribute, stringLocalizer)

View File

@ -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<RequiredAttribute>
internal class RequiredAttributeAdapter : AttributeAdapterBase<RequiredAttribute>
{
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());
}
}
}
}

View File

@ -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<StringLengthAttribute>
internal class StringLengthAttributeAdapter : AttributeAdapterBase<StringLengthAttribute>
{
private readonly string _max;
private readonly string _min;

View File

@ -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<ModelValidationResult> Validate(ModelValidationContext context)
{

View File

@ -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

View File

@ -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;

View File

@ -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
{
/// <summary>
/// Sets up JSON formatter options for <see cref="MvcOptions"/>.
/// </summary>
public class MvcJsonMvcOptionsSetup : IConfigureOptions<MvcOptions>
internal class MvcJsonMvcOptionsSetup : IConfigureOptions<MvcOptions>
{
private readonly ILoggerFactory _loggerFactory;
private readonly MvcJsonOptions _jsonOptions;

View File

@ -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<MvcJsonOptions>
{

View File

@ -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<T> : IArrayPool<T>
internal class JsonArrayPool<T> : IArrayPool<T>
{
private readonly ArrayPool<T> _inner;

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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
{
/// <summary>
/// Executes a <see cref="JsonResult"/> to write to the response.
/// </summary>
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<char> _charPool;
/// <summary>
@ -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<char>(charPool);
}
/// <summary>
/// Gets the <see cref="ILogger"/>.
/// </summary>
protected ILogger Logger { get; }
/// <summary>
/// Gets the <see cref="MvcJsonOptions"/>.
/// </summary>
protected MvcJsonOptions Options { get; }
/// <summary>
/// Gets the <see cref="IHttpResponseStreamWriterFactory"/>.
/// </summary>
protected IHttpResponseStreamWriterFactory WriterFactory { get; }
/// <summary>
/// Executes the <see cref="JsonResult"/> and writes the response.
/// </summary>
/// <param name="context">The <see cref="ActionContext"/>.</param>
/// <param name="result">The <see cref="JsonResult"/>.</param>
/// <returns>A <see cref="Task"/> which will complete when writing has completed.</returns>
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))
{

View File

@ -4,12 +4,12 @@
using Microsoft.Extensions.ObjectPool;
using Newtonsoft.Json;
namespace Microsoft.AspNetCore.Mvc.Formatters.Json.Internal
namespace Microsoft.AspNetCore.Mvc.Formatters
{
/// <summary>
/// <see cref="IPooledObjectPolicy{T}"/> for <see cref="JsonSerializer"/>.
/// </summary>
public class JsonSerializerObjectPolicy : IPooledObjectPolicy<JsonSerializer>
internal class JsonSerializerObjectPolicy : IPooledObjectPolicy<JsonSerializer>
{
private readonly JsonSerializerSettings _serializerSettings;

View File

@ -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();

View File

@ -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
{

View File

@ -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")]

View File

@ -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<MvcXmlOptions>
{

View File

@ -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
{
/// <summary>
/// A <see cref="IConfigureOptions{TOptions}"/> implementation which will add the

View File

@ -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
{
/// <summary>
/// A <see cref="IConfigureOptions{TOptions}"/> implementation which will add the

View File

@ -4,12 +4,12 @@
using System.Runtime.Serialization;
using System.Xml;
namespace Microsoft.AspNetCore.Mvc.Formatters.Xml.Internal
namespace Microsoft.AspNetCore.Mvc.Formatters.Xml
{
/// <summary>
/// Contains methods which are used by Xml input formatters.
/// </summary>
public static class FormattingUtilities
internal static class FormattingUtilities
{
public static readonly int DefaultMaxDepth = 32;
public static readonly XsdDataContractExporter XsdDataContractExporter = new XsdDataContractExporter();

View File

@ -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<ILogger, string, Exception> _failedToCreateXmlSerializer;
private static readonly Action<ILogger, string, Exception> _failedToCreateDataContractSerializer;

View File

@ -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
{

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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
{
/// <summary>
/// Methods for determining how an <see cref="ITagHelper"/> should run based on the attributes that were specified.
/// </summary>
public static class AttributeMatcher
internal static class AttributeMatcher
{
/// <summary>
/// Determines the most effective mode a <see cref="ITagHelper" /> 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;
}
}
}
}

View File

@ -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<IHtmlContent> 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

View File

@ -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 <see cref="CacheTagHelper"/>.</param>
/// <param name="htmlEncoder">The <see cref="HtmlEncoder"/> to use.</param>
public CacheTagHelper(
#pragma warning disable PUB0001 // Pubternal type in public API
CacheTagHelperMemoryCacheFactory factory,
#pragma warning restore PUB0001
HtmlEncoder htmlEncoder)
: base(htmlEncoder)
{

View File

@ -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
{

View File

@ -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<string> values)
{

View File

@ -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

View File

@ -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);
}
}
}
}

View File

@ -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; }
}
}
}

View File

@ -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
{
/// <summary>
/// Utility methods for <see cref="AspNetCore.Razor.TagHelpers.ITagHelper"/>'s that support
@ -381,4 +381,4 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal
}
}
}
}
}

View File

@ -7,12 +7,12 @@ using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace Microsoft.AspNetCore.Mvc.TagHelpers.Internal
namespace Microsoft.AspNetCore.Mvc.TagHelpers
{
/// <summary>
/// Methods for loading JavaScript from assembly embedded resources.
/// </summary>
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);
}
}
}
}

View File

@ -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; }

View File

@ -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
{
/// <summary>
/// A mapping of a <see cref="AspNetCore.Razor.TagHelpers.ITagHelper"/> mode to its required attributes.
/// </summary>
/// <typeparam name="TMode">The type representing the <see cref="AspNetCore.Razor.TagHelpers.ITagHelper"/>'s mode.</typeparam>
public class ModeAttributes<TMode>
internal class ModeAttributes<TMode>
{
/// <summary>
/// Initializes a new instance of <see cref="ModeAttributes{TMode}"/>.

View File

@ -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
{

View File

@ -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 <option/> element a child of a <select/> element the SelectTagHelper targeted?
object formDataEntry;
context.Items.TryGetValue(typeof(SelectTagHelper), out formDataEntry);
context.Items.TryGetValue(typeof(SelectTagHelper), out var formDataEntry);
// ... And did the SelectTagHelper determine any selected values?
var currentValues = formDataEntry as CurrentValues;

View File

@ -10,7 +10,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;
@ -209,9 +208,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
// Shared writer for determining the string content of a TagHelperAttribute's Value.
private StringWriter StringWriter

View File

@ -7,7 +7,6 @@ using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.AspNetCore.Mvc.TagHelpers.Internal;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Razor.TagHelpers;

View File

@ -116,8 +116,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
}
else if (string.Equals(attribute.Key, "class", StringComparison.OrdinalIgnoreCase))
{
TagHelperAttribute classAttribute;
var found = tagHelperOutput.Attributes.TryGetAttribute("class", out classAttribute);
var found = tagHelperOutput.Attributes.TryGetAttribute("class", out var classAttribute);
Debug.Assert(found);
var newAttribute = new TagHelperAttribute(
@ -394,8 +393,7 @@ namespace Microsoft.AspNetCore.Mvc.TagHelpers
var wroteLeft = false;
if (_left != null)
{
var htmlContent = _left as IHtmlContent;
if (htmlContent != null)
if (_left is IHtmlContent htmlContent)
{
// Ignore case where htmlContent is HtmlString.Empty. At worst, will add a leading space to the
// generated attribute value.

View File

@ -3,5 +3,30 @@
"TypeId": "public class Microsoft.AspNetCore.Mvc.TagHelpers.PartialTagHelper : Microsoft.AspNetCore.Razor.TagHelpers.TagHelper",
"MemberId": "public .ctor(Microsoft.AspNetCore.Mvc.ViewEngines.ICompositeViewEngine viewEngine, Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.IViewBufferScope viewBufferScope)",
"Kind": "Removal"
},
{
"TypeId": "public class Microsoft.AspNetCore.Mvc.TagHelpers.LinkTagHelper : Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper",
"MemberId": "protected Microsoft.AspNetCore.Mvc.TagHelpers.Internal.GlobbingUrlBuilder get_GlobbingUrlBuilder()",
"Kind": "Removal"
},
{
"TypeId": "public class Microsoft.AspNetCore.Mvc.TagHelpers.LinkTagHelper : Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper",
"MemberId": "protected System.Void set_GlobbingUrlBuilder(Microsoft.AspNetCore.Mvc.TagHelpers.Internal.GlobbingUrlBuilder value)",
"Kind": "Removal"
},
{
"TypeId": "public class Microsoft.AspNetCore.Mvc.TagHelpers.ScriptTagHelper : Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper",
"MemberId": "protected Microsoft.AspNetCore.Mvc.TagHelpers.Internal.GlobbingUrlBuilder get_GlobbingUrlBuilder()",
"Kind": "Removal"
},
{
"TypeId": "public class Microsoft.AspNetCore.Mvc.TagHelpers.ScriptTagHelper : Microsoft.AspNetCore.Mvc.Razor.TagHelpers.UrlResolutionTagHelper",
"MemberId": "protected System.Void set_GlobbingUrlBuilder(Microsoft.AspNetCore.Mvc.TagHelpers.Internal.GlobbingUrlBuilder value)",
"Kind": "Removal"
},
{
"TypeId": "public class Microsoft.AspNetCore.Mvc.TagHelpers.CacheTagHelper : Microsoft.AspNetCore.Mvc.TagHelpers.CacheTagHelperBase",
"MemberId": "public .ctor(Microsoft.AspNetCore.Mvc.TagHelpers.Internal.CacheTagHelperMemoryCacheFactory factory, System.Text.Encodings.Web.HtmlEncoder htmlEncoder)",
"Kind": "Removal"
}
]

View File

@ -4,7 +4,6 @@
using System;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.DataAnnotations;
using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;

View File

@ -22,10 +22,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
/// <param name="expressionTextCache">The <see cref="ExpressionTextCache"/>.</param>
public ModelExpressionProvider(
IModelMetadataProvider modelMetadataProvider,
#pragma warning disable PUB0001 // Pubternal type in public API
ExpressionTextCache expressionTextCache
#pragma warning restore PUB0001
)
ExpressionTextCache expressionTextCache)
{
if (modelMetadataProvider == null)
{

View File

@ -9,11 +9,11 @@ using System.Linq;
using Microsoft.AspNetCore.Mvc.DataAnnotations;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.AspNetCore.Mvc.Routing;
using Microsoft.AspNetCore.Mvc.ViewFeatures;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using Resources = Microsoft.AspNetCore.Mvc.ViewFeatures.Resources;
namespace Microsoft.AspNetCore.Mvc
{

View File

@ -12,7 +12,6 @@ using Microsoft.AspNetCore.JsonPatch;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.AspNetCore.Mvc.DataAnnotations;
using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.AspNetCore.Testing;

View File

@ -4,7 +4,6 @@
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Microsoft.AspNetCore.Mvc.DataAnnotations;
using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation

View File

@ -5,7 +5,7 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal;
using Microsoft.AspNetCore.Mvc.DataAnnotations;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation

View File

@ -4,7 +4,6 @@
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Microsoft.AspNetCore.Mvc.DataAnnotations;
using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation

View File

@ -3,7 +3,6 @@
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.DataAnnotations;
using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal;
using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.AspNetCore.Mvc.DataAnnotations;
using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.Extensions.Localization;

View File

@ -17,7 +17,7 @@ using Microsoft.Extensions.Options;
using Moq;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.Cors.Internal
namespace Microsoft.AspNetCore.Mvc.Cors
{
public class CorsApplicationModelProviderTest
{

View File

@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.Primitives;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.Cors.Internal
namespace Microsoft.AspNetCore.Mvc.Cors
{
public class CorsHttpMethodActionConstraintTest
{

View File

@ -6,7 +6,6 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Cors.Infrastructure;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.Cors.Internal;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Routing;
using Xunit;

View File

@ -11,7 +11,7 @@ using Microsoft.Extensions.Localization;
using Moq;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
{
public class CompareAttributeAdapterTest
{
@ -254,4 +254,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
public string OtherProperty { get; set; }
}
}
}
}

View File

@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.Extensions.Options;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
{
public class DataAnnotationsClientModelValidatorProviderTest
{

View File

@ -15,7 +15,7 @@ using Microsoft.Extensions.Options;
using Moq;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
{
public enum TestEnum
{

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.Extensions.Options;

View File

@ -12,7 +12,7 @@ using Microsoft.Extensions.Localization;
using Moq;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
{
public class DataAnnotationsModelValidatorTest
{

View File

@ -7,7 +7,7 @@ using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
{
public class DataMemberRequiredBindingMetadataProviderTest
{

View File

@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
{
public class DataTypeClientModelValidatorProviderTest
{

View File

@ -9,7 +9,7 @@ using Microsoft.AspNetCore.Mvc.ModelBinding;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
{
// Integration tests for the default configuration of ModelMetadata and Validation providers
public class DefaultModelClientValidatorProviderTest
@ -273,4 +273,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
public string Name { get; set; }
}
}
}
}

View File

@ -3,7 +3,7 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc.DataAnnotations.Internal;
using Microsoft.AspNetCore.Mvc.DataAnnotations;
using Microsoft.AspNetCore.Testing;
using Microsoft.Extensions.Localization;
using Moq;

View File

@ -10,7 +10,7 @@ using Microsoft.Extensions.Localization;
using Moq;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
{
public class MaxLengthAttributeAdapterTest
{

View File

@ -9,5 +9,4 @@
<PackageReference Include="Microsoft.Extensions.Logging.Testing" Version="$(MicrosoftExtensionsLoggingTestingPackageVersion)" />
</ItemGroup>
</Project>

View File

@ -10,7 +10,7 @@ using Microsoft.Extensions.Localization;
using Moq;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
namespace Microsoft.AspNetCore.Mvc.DataAnnotations
{
public class MinLengthAttributeAdapterTest
{
@ -133,4 +133,4 @@ namespace Microsoft.AspNetCore.Mvc.DataAnnotations.Internal
kvp => { Assert.Equal("data-val-minlength-min", kvp.Key); Assert.Equal("original", kvp.Value); });
}
}
}
}

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