diff --git a/src/Microsoft.AspNet.JsonPatch/Exceptions/JsonPatchException.cs b/src/Microsoft.AspNet.JsonPatch/Exceptions/JsonPatchException.cs index b0c4b051ea..28a1accd05 100644 --- a/src/Microsoft.AspNet.JsonPatch/Exceptions/JsonPatchException.cs +++ b/src/Microsoft.AspNet.JsonPatch/Exceptions/JsonPatchException.cs @@ -11,7 +11,8 @@ namespace Microsoft.AspNet.JsonPatch.Exceptions public Operation FailedOperation { get; private set; } public new TModel AffectedObject { get; private set; } - private string _message = ""; + private string _message = string.Empty; + public override string Message { get diff --git a/src/Microsoft.AspNet.JsonPatch/Exceptions/JsonPatchExceptionBase.cs b/src/Microsoft.AspNet.JsonPatch/Exceptions/JsonPatchExceptionBase.cs index 0162c7201e..8891b63cf9 100644 --- a/src/Microsoft.AspNet.JsonPatch/Exceptions/JsonPatchExceptionBase.cs +++ b/src/Microsoft.AspNet.JsonPatch/Exceptions/JsonPatchExceptionBase.cs @@ -11,19 +11,18 @@ namespace Microsoft.AspNet.JsonPatch.Exceptions public object AffectedObject { get; private set; } - private string _message = ""; + private string _message = string.Empty; + public override string Message { get { return _message; } - } public JsonPatchException() { - } public JsonPatchException(string message, Exception innerException) diff --git a/src/Microsoft.AspNet.JsonPatch/Helpers/ExpressionHelpers.cs b/src/Microsoft.AspNet.JsonPatch/Helpers/ExpressionHelpers.cs index 45dbe9321a..6a0279876c 100644 --- a/src/Microsoft.AspNet.JsonPatch/Helpers/ExpressionHelpers.cs +++ b/src/Microsoft.AspNet.JsonPatch/Helpers/ExpressionHelpers.cs @@ -59,9 +59,9 @@ namespace Microsoft.AspNet.JsonPatch.Helpers } case ExpressionType.Parameter: // Fits "x => x" (the whole document which is "" as JSON pointer) - return firstTime ? "" : null; + return firstTime ? string.Empty : null; default: - return ""; + return string.Empty; } } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/ModelBinding/Validation/ModelValidationContext.cs b/src/Microsoft.AspNet.Mvc.Abstractions/ModelBinding/Validation/ModelValidationContext.cs index ff1a2bda7d..f5ed4860e3 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/ModelBinding/Validation/ModelValidationContext.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/ModelBinding/Validation/ModelValidationContext.cs @@ -11,10 +11,10 @@ namespace Microsoft.AspNet.Mvc.ModelBinding.Validation [NotNull] ModelBindingContext bindingContext, [NotNull] ModelExplorer modelExplorer) : this( - bindingContext.BindingSource, - bindingContext.OperationBindingContext.ValidatorProvider, - bindingContext.ModelState, - modelExplorer) + bindingContext.BindingSource, + bindingContext.OperationBindingContext.ValidatorProvider, + bindingContext.ModelState, + modelExplorer) { } @@ -35,9 +35,13 @@ namespace Microsoft.AspNet.Mvc.ModelBinding.Validation /// and . /// /// Existing . - /// associated with the new - /// . - /// + /// + /// associated with the new . + /// + /// + /// A new instance of the class using the + /// and . + /// public static ModelValidationContext GetChildValidationContext( [NotNull] ModelValidationContext parentContext, [NotNull] ModelExplorer modelExplorer) diff --git a/src/Microsoft.AspNet.Mvc.ApiExplorer/DefaultApiDescriptionProvider.cs b/src/Microsoft.AspNet.Mvc.ApiExplorer/DefaultApiDescriptionProvider.cs index 20fd1f22b6..bc72e68208 100644 --- a/src/Microsoft.AspNet.Mvc.ApiExplorer/DefaultApiDescriptionProvider.cs +++ b/src/Microsoft.AspNet.Mvc.ApiExplorer/DefaultApiDescriptionProvider.cs @@ -275,7 +275,7 @@ namespace Microsoft.AspNet.Mvc.ApiExplorer foreach (var segment in parsedTemplate.Segments) { - var currentSegment = ""; + var currentSegment = string.Empty; foreach (var part in segment.Parts) { if (part.IsLiteral) diff --git a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/AttributeRouteModel.cs b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/AttributeRouteModel.cs index 8f177b4072..811499ad51 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/AttributeRouteModel.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/AttributeRouteModel.cs @@ -177,7 +177,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels // We are in the case where the string is "/" or "~/" if (startIndex == result.Length) { - return ""; + return string.Empty; } var subStringLength = result.Length - startIndex; diff --git a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultApplicationModelProvider.cs b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultApplicationModelProvider.cs index b02f14a3de..a49401c024 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultApplicationModelProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultApplicationModelProvider.cs @@ -427,8 +427,8 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels /// /// Returns true if the is an action. Otherwise false. /// - /// The . /// The . + /// The . /// true if the is an action. Otherwise false. /// /// Override this method to provide custom logic to determine which methods are considered actions. diff --git a/src/Microsoft.AspNet.Mvc.Core/Internal/MvcServicesHelper.cs b/src/Microsoft.AspNet.Mvc.Core/Internal/MvcServicesHelper.cs index af5e5b3dd9..379f904c8b 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Internal/MvcServicesHelper.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Internal/MvcServicesHelper.cs @@ -16,7 +16,6 @@ namespace Microsoft.AspNet.Mvc.Internal /// in the list of services. /// /// The list of services. - /// The type of service which needs to be searched for. public static void ThrowIfMvcNotRegistered(IServiceProvider services) { if (services.GetService(typeof(MvcMarkerService)) == null) diff --git a/src/Microsoft.AspNet.Mvc.Core/ModelBinding/CollectionModelBinder.cs b/src/Microsoft.AspNet.Mvc.Core/ModelBinding/CollectionModelBinder.cs index 7992c02c5e..f207b25c4d 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ModelBinding/CollectionModelBinder.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ModelBinding/CollectionModelBinder.cs @@ -168,7 +168,7 @@ namespace Microsoft.AspNet.Mvc.ModelBinding else { indexNamesIsFinite = false; - indexNames = Enumerable.Range(0, Int32.MaxValue) + indexNames = Enumerable.Range(0, int.MaxValue) .Select(i => i.ToString(CultureInfo.InvariantCulture)); } diff --git a/src/Microsoft.AspNet.Mvc.Core/ModelBinding/ModelMetadataProviderExtensions.cs b/src/Microsoft.AspNet.Mvc.Core/ModelBinding/ModelMetadataProviderExtensions.cs index b1444636c6..a254a1e2ef 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ModelBinding/ModelMetadataProviderExtensions.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ModelBinding/ModelMetadataProviderExtensions.cs @@ -19,7 +19,9 @@ namespace Microsoft.AspNet.Mvc.ModelBinding /// The . /// The declared of the model object. /// The model object. - /// + /// + /// A for the and . + /// public static ModelExplorer GetModelExplorerForType( [NotNull] this IModelMetadataProvider provider, [NotNull] Type modelType, diff --git a/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoutePrecedence.cs b/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoutePrecedence.cs index a48c380b02..d7601eb95c 100644 --- a/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoutePrecedence.cs +++ b/src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoutePrecedence.cs @@ -26,7 +26,7 @@ namespace Microsoft.AspNet.Mvc.Routing var digit = ComputeDigit(segment); Debug.Assert(digit >= 0 && digit < 10); - precedence += Decimal.Divide(digit, (decimal)Math.Pow(10, i)); + precedence += decimal.Divide(digit, (decimal)Math.Pow(10, i)); } return precedence; diff --git a/src/Microsoft.AspNet.Mvc.Extensions/AntiForgery/AntiForgeryTokenProvider.cs b/src/Microsoft.AspNet.Mvc.Extensions/AntiForgery/AntiForgeryTokenProvider.cs index 6bb4ab6443..fc0b92a18f 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/AntiForgery/AntiForgeryTokenProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/AntiForgery/AntiForgeryTokenProvider.cs @@ -132,7 +132,7 @@ namespace Microsoft.AspNet.Mvc currentUsername.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || currentUsername.StartsWith("https://", StringComparison.OrdinalIgnoreCase); - if (!String.Equals(fieldToken.Username, + if (!string.Equals(fieldToken.Username, currentUsername, (useCaseSensitiveUsernameComparison) ? StringComparison.Ordinal : diff --git a/src/Microsoft.AspNet.Mvc.Extensions/AntiForgery/DefaultClaimUidExtractor.cs b/src/Microsoft.AspNet.Mvc.Extensions/AntiForgery/DefaultClaimUidExtractor.cs index 65df63eeb7..9f748560d1 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/AntiForgery/DefaultClaimUidExtractor.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/AntiForgery/DefaultClaimUidExtractor.cs @@ -31,9 +31,8 @@ namespace Microsoft.AspNet.Mvc internal static IEnumerable GetUniqueIdentifierParameters(ClaimsIdentity claimsIdentity) { - var nameIdentifierClaim = claimsIdentity.FindFirst(claim => - String.Equals(ClaimTypes.NameIdentifier, - claim.Type, StringComparison.Ordinal)); + var nameIdentifierClaim = claimsIdentity.FindFirst( + claim => string.Equals(ClaimTypes.NameIdentifier, claim.Type, StringComparison.Ordinal)); if (nameIdentifierClaim != null && !string.IsNullOrEmpty(nameIdentifierClaim.Value)) { return new string[] diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Authorization/AuthorizeFilter.cs b/src/Microsoft.AspNet.Mvc.Extensions/Authorization/AuthorizeFilter.cs index 5e1881d63e..7403af9348 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Authorization/AuthorizeFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Authorization/AuthorizeFilter.cs @@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Mvc /// /// Authorize filter for a specific policy. /// - /// + /// Authorization policy to be used. public AuthorizeFilter([NotNull] AuthorizationPolicy policy) { Policy = policy; diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Cors/CorsAuthorizationFilterFactory.cs b/src/Microsoft.AspNet.Mvc.Extensions/Cors/CorsAuthorizationFilterFactory.cs index 0f7331ab2e..cf44ac20ed 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Cors/CorsAuthorizationFilterFactory.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Cors/CorsAuthorizationFilterFactory.cs @@ -2,12 +2,6 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNet.Cors.Core; -using Microsoft.AspNet.Http; -using Microsoft.AspNet.WebUtilities; using Microsoft.Framework.DependencyInjection; using Microsoft.Framework.Internal; @@ -21,9 +15,9 @@ namespace Microsoft.AspNet.Mvc private readonly string _policyName; /// - /// Creates a new insntace of . + /// Creates a new instance of . /// - /// + /// Name used to fetch a CORS policy. public CorsAuthorizationFilterFactory(string policyName) { _policyName = policyName; diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Filters/FormatFilterAttribute.cs b/src/Microsoft.AspNet.Mvc.Extensions/Filters/FormatFilterAttribute.cs index a12617c88f..e0b10a4c1d 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Filters/FormatFilterAttribute.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Filters/FormatFilterAttribute.cs @@ -8,17 +8,17 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc { /// - /// A filter which will use the format value in the route data or query string to set the content type on an + /// A filter which will use the format value in the route data or query string to set the content type on an /// returned from an action. /// [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] public class FormatFilterAttribute : Attribute, IFilterFactory { /// - /// Creates an instance of + /// Creates an instance of . /// - /// The - /// An instance of + /// The . + /// An instance of . public IFilter CreateInstance([NotNull] IServiceProvider serviceProvider) { return serviceProvider.GetRequiredService(); diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Rendering/Html/DefaultHtmlGenerator.cs b/src/Microsoft.AspNet.Mvc.Extensions/Rendering/Html/DefaultHtmlGenerator.cs index aad2d90ddb..19c35ec303 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Rendering/Html/DefaultHtmlGenerator.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Rendering/Html/DefaultHtmlGenerator.cs @@ -117,7 +117,7 @@ namespace Microsoft.AspNet.Mvc.Rendering if (modelExplorer.Model != null) { bool modelChecked; - if (Boolean.TryParse(modelExplorer.Model.ToString(), out modelChecked)) + if (bool.TryParse(modelExplorer.Model.ToString(), out modelChecked)) { isChecked = modelChecked; } diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Rendering/HtmlHelperPartialExtensions.cs b/src/Microsoft.AspNet.Mvc.Extensions/Rendering/HtmlHelperPartialExtensions.cs index 1f37479039..4b2ca68954 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Rendering/HtmlHelperPartialExtensions.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Rendering/HtmlHelperPartialExtensions.cs @@ -139,6 +139,7 @@ namespace Microsoft.AspNet.Mvc.Rendering /// /// Returns HTML markup for the specified partial view. /// + /// The instance this method extends. /// /// The name of the partial view used to create the HTML markup. Must not be null. /// diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Rendering/HtmlString.cs b/src/Microsoft.AspNet.Mvc.Extensions/Rendering/HtmlString.cs index fb0963f352..792dcc6f54 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Rendering/HtmlString.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Rendering/HtmlString.cs @@ -21,7 +21,9 @@ namespace Microsoft.AspNet.Mvc.Rendering /// /// Initializes a new instance of that is backed by . /// - /// + /// + /// A instance to back this . + /// public HtmlString([NotNull] StringCollectionTextWriter writer) { _writer = writer; @@ -36,7 +38,8 @@ namespace Microsoft.AspNet.Mvc.Rendering } /// - /// Writes the value in this instance of to the target . + /// Writes the value in this instance of to the target + /// . /// /// The to write contents to. public void WriteTo(TextWriter targetWriter) diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Rendering/ViewEngine/IViewEngine.cs b/src/Microsoft.AspNet.Mvc.Extensions/Rendering/ViewEngine/IViewEngine.cs index 8c16f3e003..7a1a755912 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Rendering/ViewEngine/IViewEngine.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Rendering/ViewEngine/IViewEngine.cs @@ -20,7 +20,7 @@ namespace Microsoft.AspNet.Mvc.Rendering /// Finds the specified partial view by using the specified action context. /// /// The action context. - /// The name or full path to the view. + /// The name or full path to the view. /// A result representing the result of locating the view. ViewEngineResult FindPartialView(ActionContext context, string partialViewName); } diff --git a/src/Microsoft.AspNet.Mvc.Extensions/ViewComponents/ContentViewComponentResult.cs b/src/Microsoft.AspNet.Mvc.Extensions/ViewComponents/ContentViewComponentResult.cs index 343781880b..aab3e566e2 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/ViewComponents/ContentViewComponentResult.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/ViewComponents/ContentViewComponentResult.cs @@ -35,7 +35,7 @@ namespace Microsoft.AspNet.Mvc /// /// Initializes a new . /// - /// + /// /// Content to write. The content is treated as already HTML encoded, and no further encoding /// will be performed. /// diff --git a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/SetBaseTypeChunkMerger.cs b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/SetBaseTypeChunkMerger.cs index 92cd2789f0..c226f3b6c0 100644 --- a/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/SetBaseTypeChunkMerger.cs +++ b/src/Microsoft.AspNet.Mvc.Razor.Host/Directives/SetBaseTypeChunkMerger.cs @@ -17,7 +17,7 @@ namespace Microsoft.AspNet.Mvc.Razor.Directives /// /// Initializes a new instance of . /// - /// The type name of the model used by default. + /// The type name of the model used by default. public SetBaseTypeChunkMerger(string modelType) { _modelType = "<" + modelType + ">"; diff --git a/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs b/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs index 69fa3e4744..97e5f779b7 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs @@ -43,8 +43,13 @@ namespace Microsoft.AspNet.Mvc.Razor.Compilation /// Initalizes a new instance of the class. /// /// The environment for the executing application. - /// The loader used to load compiled assemblies. + /// + /// The accessor for the used to load compiled assemblies. + /// /// The library manager that provides export and reference information. + /// + /// The that provides Roslyn compilation settings. + /// /// The that was used to generate the code. public RoslynCompilationService(IApplicationEnvironment environment, IAssemblyLoadContextAccessor loaderAccessor, diff --git a/src/Microsoft.AspNet.Mvc.Razor/IRazorViewEngine.cs b/src/Microsoft.AspNet.Mvc.Razor/IRazorViewEngine.cs index e459802922..45ac1b9fd4 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/IRazorViewEngine.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/IRazorViewEngine.cs @@ -15,7 +15,7 @@ namespace Microsoft.AspNet.Mvc.Razor /// . /// /// The . - /// The name or full path to the view. + /// The name or full path to the view. /// A result representing the result of locating the . RazorPageResult FindPage(ActionContext context, string page); } diff --git a/src/Microsoft.AspNet.Mvc.Razor/RazorPage.cs b/src/Microsoft.AspNet.Mvc.Razor/RazorPage.cs index 3ab6edb827..9fab07d41e 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/RazorPage.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/RazorPage.cs @@ -506,6 +506,7 @@ namespace Microsoft.AspNet.Mvc.Razor /// /// Writes the specified without HTML encoding to . /// + /// The instance to write to. /// The to write. public virtual void WriteLiteralTo([NotNull] TextWriter writer, string value) { diff --git a/src/Microsoft.AspNet.Mvc.Razor/RazorPageResult.cs b/src/Microsoft.AspNet.Mvc.Razor/RazorPageResult.cs index 6b9a7d7415..1c7a1bc6b9 100644 --- a/src/Microsoft.AspNet.Mvc.Razor/RazorPageResult.cs +++ b/src/Microsoft.AspNet.Mvc.Razor/RazorPageResult.cs @@ -26,7 +26,7 @@ namespace Microsoft.AspNet.Mvc.Razor /// Initializes a new instance of for an unsuccessful discovery. /// /// The name of the page that was located. - /// The locations that were searched. + /// The locations that were searched. public RazorPageResult([NotNull] string name, [NotNull] IEnumerable searchedLocations) { Name = name; diff --git a/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/JavaScriptStringArrayEncoder.cs b/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/JavaScriptStringArrayEncoder.cs index 3b344dd76b..7b2c1acb51 100644 --- a/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/JavaScriptStringArrayEncoder.cs +++ b/src/Microsoft.AspNet.Mvc.TagHelpers/Internal/JavaScriptStringArrayEncoder.cs @@ -8,7 +8,7 @@ using Microsoft.Framework.WebEncoders; namespace Microsoft.AspNet.Mvc.TagHelpers.Internal { /// - /// Methods for encoding for use as a JavaScript array literal. + /// Methods for encoding for use as a JavaScript array literal. /// public static class JavaScriptStringArrayEncoder { @@ -22,7 +22,7 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Internal var firstAdded = false; writer.Write('['); - + foreach (var value in values) { if (firstAdded) diff --git a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ActionResults/ExceptionResult.cs b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ActionResults/ExceptionResult.cs index c7b8aeefa9..4aef762db8 100644 --- a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ActionResults/ExceptionResult.cs +++ b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ActionResults/ExceptionResult.cs @@ -18,9 +18,6 @@ namespace System.Web.Http /// /// if the error should include exception messages; otherwise, . /// - /// The content negotiator to handle content negotiation. - /// The request message which led to this result. - /// The formatters to use to negotiate and format the content. public ExceptionResult(Exception exception, bool includeErrorDetail) : base(new HttpError(exception, includeErrorDetail)) { diff --git a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ActionResults/OkNegotiatedContentResult.cs b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ActionResults/OkNegotiatedContentResult.cs index db7d85ea78..be288e604b 100644 --- a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ActionResults/OkNegotiatedContentResult.cs +++ b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ActionResults/OkNegotiatedContentResult.cs @@ -19,7 +19,6 @@ namespace System.Web.Http /// provided. /// /// The content value to negotiate and format in the entity body. - /// The formatters to use to negotiate and format the content. public OkNegotiatedContentResult([NotNull] T content) : base(HttpStatusCode.OK, content) { diff --git a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ApiController.cs b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ApiController.cs index 453f76ce03..29ca1ae261 100644 --- a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ApiController.cs +++ b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ApiController.cs @@ -180,7 +180,7 @@ namespace System.Web.Http /// /// Creates a (201 Created) with the specified values. /// - /// The location at which the content has been created. + /// The location at which the content has been created. /// The content value to format in the entity body. /// A with the specified values. [NonAction] diff --git a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/FormattingUtilities.cs b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/FormattingUtilities.cs index 26cd1e05e2..6a782366c9 100644 --- a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/FormattingUtilities.cs +++ b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/FormattingUtilities.cs @@ -138,7 +138,7 @@ namespace System.Net.Http HttpContentHeaders contentHeaders = null; try { - tempContent = new StringContent(String.Empty); + tempContent = new StringContent(string.Empty); contentHeaders = tempContent.Headers; contentHeaders.Clear(); } @@ -155,9 +155,9 @@ namespace System.Net.Http } /// - /// Create a default reader quotas with a default depth quota of 1K + /// Create a default reader quotas with a default depth quota of 1K. /// - /// + /// A default with a default depth quota of 1K. public static XmlDictionaryReaderQuotas CreateDefaultReaderQuotas() { // MaxDepth is a DOS mitigation. We don't support MaxDepth in portable libraries because it is strictly @@ -167,11 +167,11 @@ namespace System.Net.Http #else return new XmlDictionaryReaderQuotas() { - MaxArrayLength = Int32.MaxValue, - MaxBytesPerRead = Int32.MaxValue, + MaxArrayLength = int.MaxValue, + MaxBytesPerRead = int.MaxValue, MaxDepth = DefaultMaxDepth, - MaxNameTableCharCount = Int32.MaxValue, - MaxStringContentLength = Int32.MaxValue + MaxNameTableCharCount = int.MaxValue, + MaxStringContentLength = int.MaxValue }; #endif } @@ -183,7 +183,7 @@ namespace System.Net.Http /// Unquoted token. public static string UnquoteToken(string token) { - if (String.IsNullOrWhiteSpace(token)) + if (string.IsNullOrWhiteSpace(token)) { return token; } @@ -237,7 +237,7 @@ namespace System.Net.Http /// True if value was valid; false otherwise. public static bool TryParseInt32(string value, out int result) { - return Int32.TryParse(value, NumberStyles.None, NumberFormatInfo.InvariantInfo, out result); + return int.TryParse(value, NumberStyles.None, NumberFormatInfo.InvariantInfo, out result); } } } diff --git a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/MediaTypeWithQualityHeaderComparer.cs b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/MediaTypeWithQualityHeaderComparer.cs index 5b1175fc30..a62757f530 100644 --- a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/MediaTypeWithQualityHeaderComparer.cs +++ b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/MediaTypeWithQualityHeaderComparer.cs @@ -37,13 +37,17 @@ namespace System.Net.Http.Formatting /// /// The first to compare. /// The second to compare. - /// + /// + /// 0 if and are considered equal. + /// 1 if is considered greater than . + /// -1 otherwise ( is considered less than ). + /// public int Compare(MediaTypeWithQualityHeaderValue mediaType1, MediaTypeWithQualityHeaderValue mediaType2) { Debug.Assert(mediaType1 != null, "The 'mediaType1' parameter should not be null."); Debug.Assert(mediaType2 != null, "The 'mediaType2' parameter should not be null."); - if (Object.ReferenceEquals(mediaType1, mediaType2)) + if (ReferenceEquals(mediaType1, mediaType2)) { return 0; } diff --git a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/StringWithQualityHeaderValueComparer.cs b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/StringWithQualityHeaderValueComparer.cs index cb25a8e7ef..874d1696f0 100644 --- a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/StringWithQualityHeaderValueComparer.cs +++ b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/StringWithQualityHeaderValueComparer.cs @@ -60,11 +60,11 @@ namespace System.Net.Http.Formatting if (!string.Equals(stringWithQuality1.Value, stringWithQuality2.Value, StringComparison.OrdinalIgnoreCase)) { - if (String.Equals(stringWithQuality1.Value, "*", StringComparison.Ordinal)) + if (string.Equals(stringWithQuality1.Value, "*", StringComparison.Ordinal)) { return -1; } - else if (String.Equals(stringWithQuality2.Value, "*", StringComparison.Ordinal)) + else if (string.Equals(stringWithQuality2.Value, "*", StringComparison.Ordinal)) { return 1; } diff --git a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/HttpError.cs b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/HttpError.cs index 10798edf64..c1b14bb6f7 100644 --- a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/HttpError.cs +++ b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/HttpError.cs @@ -117,7 +117,7 @@ namespace System.Web.Http /// public string Message { - get { return GetPropertyValue(HttpErrorKeys.MessageKey); } + get { return GetPropertyValue(HttpErrorKeys.MessageKey); } set { this[HttpErrorKeys.MessageKey] = value; } } @@ -145,7 +145,7 @@ namespace System.Web.Http /// public string MessageDetail { - get { return GetPropertyValue(HttpErrorKeys.MessageDetailKey); } + get { return GetPropertyValue(HttpErrorKeys.MessageDetailKey); } set { this[HttpErrorKeys.MessageDetailKey] = value; } } @@ -159,7 +159,7 @@ namespace System.Web.Http /// public string ExceptionMessage { - get { return GetPropertyValue(HttpErrorKeys.ExceptionMessageKey); } + get { return GetPropertyValue(HttpErrorKeys.ExceptionMessageKey); } set { this[HttpErrorKeys.ExceptionMessageKey] = value; } } @@ -173,7 +173,7 @@ namespace System.Web.Http /// public string ExceptionType { - get { return GetPropertyValue(HttpErrorKeys.ExceptionTypeKey); } + get { return GetPropertyValue(HttpErrorKeys.ExceptionTypeKey); } set { this[HttpErrorKeys.ExceptionTypeKey] = value; } } @@ -187,7 +187,7 @@ namespace System.Web.Http /// public string StackTrace { - get { return GetPropertyValue(HttpErrorKeys.StackTraceKey); } + get { return GetPropertyValue(HttpErrorKeys.StackTraceKey); } set { this[HttpErrorKeys.StackTraceKey] = value; } } diff --git a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageExtensions.cs b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageExtensions.cs index ac2e05059b..33557b23d5 100644 --- a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageExtensions.cs +++ b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageExtensions.cs @@ -230,7 +230,7 @@ namespace System.Net.Http /// The request. /// The status code of the created response. /// The value to wrap. Can be null. - /// The configuration to use. Can be null. + /// The set of objects from which to choose. /// A response wrapping with . public static HttpResponseMessage CreateResponse( [NotNull] this HttpRequestMessage request, diff --git a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/OverloadActionConstraint.cs b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/OverloadActionConstraint.cs index c92e65d3ef..8038424cc2 100644 --- a/src/Microsoft.AspNet.Mvc.WebApiCompatShim/OverloadActionConstraint.cs +++ b/src/Microsoft.AspNet.Mvc.WebApiCompatShim/OverloadActionConstraint.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc.WebApiCompatShim { public class OverloadActionConstraint : IActionConstraint { - public int Order { get; } = Int32.MaxValue; + public int Order { get; } = int.MaxValue; public bool Accept(ActionConstraintContext context) { diff --git a/src/Microsoft.AspNet.Mvc.Xml/SerializableErrorWrapperProviderFactory.cs b/src/Microsoft.AspNet.Mvc.Xml/SerializableErrorWrapperProviderFactory.cs index b0e19ae5fa..bc10f5bd60 100644 --- a/src/Microsoft.AspNet.Mvc.Xml/SerializableErrorWrapperProviderFactory.cs +++ b/src/Microsoft.AspNet.Mvc.Xml/SerializableErrorWrapperProviderFactory.cs @@ -1,8 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; -using Microsoft.AspNet.Mvc; using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc.Xml @@ -14,11 +12,15 @@ namespace Microsoft.AspNet.Mvc.Xml { /// /// Creates an instance of if the provided - /// declared type is . + /// 's is + /// . /// - /// - /// An instance of if the provided - /// declared type is , else null. + /// The . + /// + /// An instance of if the provided 's + /// is + /// ; otherwise null. + /// public IWrapperProvider GetProvider([NotNull] WrapperProviderContext context) { if (context.DeclaredType == typeof(SerializableError))