Permalink
Browse files

Correct StyleCop violations

- StyleCop working again (handles C# 6.0 additions) though only locally for me
- disable some new rules:
 - ConstFieldNamesMustBeginWithUpperCaseLetter
 - InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements
 - StaticReadonlyElementsMustAppearBeforeStaticNonReadonlyElements
 - StaticReadonlyFieldsMustBeginWithUpperCaseLetter
 - PrefixCallsCorrectly
- correct remaining violations
 - lots of long lines for example
 - use more `var`; some manual updates since StyleCop doesn't check seemingly-unused blocks

nit: remove new trailing whitespace (was paranoid about adding it w/ fixes)
  • Loading branch information...
1 parent 227f564 commit 6df288bce7dc94c6afbeecc9260831bcea1c638d @dougbu dougbu committed Jan 7, 2015
Showing with 674 additions and 444 deletions.
  1. +26 −1 Settings.StyleCop
  2. +1 −1 src/Microsoft.AspNet.Mvc.Common/TypeExtensions.cs
  3. +2 −2 src/Microsoft.AspNet.Mvc.Core/ActionResults/FilePathResult.cs
  4. +1 −1 src/Microsoft.AspNet.Mvc.Core/ActionResults/FileResult.cs
  5. +0 −1 src/Microsoft.AspNet.Mvc.Core/AntiForgery/AntiForgeryToken.cs
  6. +4 −2 src/Microsoft.AspNet.Mvc.Core/AntiForgery/AntiForgeryTokenStore.cs
  7. +0 −1 src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultActionModelBuilder.cs
  8. +16 −17 src/Microsoft.AspNet.Mvc.Core/Controller.cs
  9. +1 −1 src/Microsoft.AspNet.Mvc.Core/ControllerActionDescriptorProvider.cs
  10. +2 −2 src/Microsoft.AspNet.Mvc.Core/DefaultAssemblyProvider.cs
  11. +2 −1 src/Microsoft.AspNet.Mvc.Core/DefaultControllerActionArgumentBinder.cs
  12. +4 −2 src/Microsoft.AspNet.Mvc.Core/DefaultPropertyBindingPredicateProvider.cs
  13. +2 −2 src/Microsoft.AspNet.Mvc.Core/Description/DefaultApiDescriptionProvider.cs
  14. +0 −1 src/Microsoft.AspNet.Mvc.Core/Filters/IAuthorizationFilter.cs
  15. +0 −1 src/Microsoft.AspNet.Mvc.Core/Filters/IExceptionFilter.cs
  16. +0 −1 src/Microsoft.AspNet.Mvc.Core/Formatters/IInputFormatterSelector.cs
  17. +1 −1 src/Microsoft.AspNet.Mvc.Core/HttpMethodAttribute.cs
  18. +2 −1 src/Microsoft.AspNet.Mvc.Core/Logging/ActionConstraintValues.cs
  19. +2 −1 src/Microsoft.AspNet.Mvc.Core/Logging/ActionDescriptorValues.cs
  20. +1 −1 src/Microsoft.AspNet.Mvc.Core/Logging/AttributeRouteModelValues.cs
  21. +1 −1 src/Microsoft.AspNet.Mvc.Core/Logging/ControllerModelValues.cs
  22. +4 −1 src/Microsoft.AspNet.Mvc.Core/Logging/FilterValues.cs
  23. +1 −1 src/Microsoft.AspNet.Mvc.Core/ModelBinders/BodyModelBinder.cs
  24. +1 −1 src/Microsoft.AspNet.Mvc.Core/ParameterBinding/ModelBindingHelper.cs
  25. +5 −2 src/Microsoft.AspNet.Mvc.Core/Rendering/Html/DefaultHtmlGenerator.cs
  26. +0 −1 src/Microsoft.AspNet.Mvc.Core/Rendering/Html/HtmlHelper.cs
  27. +2 −2 src/Microsoft.AspNet.Mvc.Core/Rendering/Html/TagBuilder.cs
  28. +1 −1 src/Microsoft.AspNet.Mvc.Core/Routing/AttributeRoute.cs
  29. +2 −1 src/Microsoft.AspNet.Mvc.Core/UrlHelper.cs
  30. +2 −2 src/Microsoft.AspNet.Mvc.Core/ViewComponents/ContentViewComponentResult.cs
  31. +1 −2 src/Microsoft.AspNet.Mvc.Core/ViewContext.cs
  32. +5 −5 src/Microsoft.AspNet.Mvc.Core/ViewDataDictionaryOfT.cs
  33. +2 −1 src/Microsoft.AspNet.Mvc.ModelBinding/BindAttribute.cs
  34. +2 −2 src/Microsoft.AspNet.Mvc.ModelBinding/Binders/CollectionModelBinder.cs
  35. +1 −1 src/Microsoft.AspNet.Mvc.ModelBinding/Binders/ComplexModelDtoModelBinder.cs
  36. +16 −14 src/Microsoft.AspNet.Mvc.ModelBinding/Binders/CompositeModelBinder.cs
  37. +1 −1 src/Microsoft.AspNet.Mvc.ModelBinding/Binders/GenericModelBinder.cs
  38. +0 −1 src/Microsoft.AspNet.Mvc.ModelBinding/Binders/ICompositeModelBinder.cs
  39. +3 −3 src/Microsoft.AspNet.Mvc.ModelBinding/Binders/KeyValuePairModelBinder.cs
  40. +1 −1 src/Microsoft.AspNet.Mvc.ModelBinding/Binders/MutableObjectModelBinder.cs
  41. +4 −1 src/Microsoft.AspNet.Mvc.ModelBinding/Metadata/IModelMetadataProvider.cs
  42. +2 −3 src/Microsoft.AspNet.Mvc.ModelBinding/ModelBindingContext.cs
  43. +0 −1 src/Microsoft.AspNet.Mvc.ModelBinding/Validation/ClientModelValidationContext.cs
  44. +7 −7 src/Microsoft.AspNet.Mvc.ModelBinding/Validation/DataAnnotationsModelValidatorProvider.cs
  45. +3 −1 src/Microsoft.AspNet.Mvc.ModelBinding/Validation/DefaultBodyModelValidator.cs
  46. +0 −1 src/Microsoft.AspNet.Mvc.ModelBinding/Validation/ModelClientValidationRegexRule.cs
  47. +2 −1 src/Microsoft.AspNet.Mvc.ModelBinding/Validation/ModelValidationNode.cs
  48. +2 −1 src/Microsoft.AspNet.Mvc.ModelBinding/ValueProviders/CompositeValueProvider.cs
  49. +3 −1 src/Microsoft.AspNet.Mvc.ModelBinding/ValueProviders/MetadataAwareValueProvider.cs
  50. +1 −1 src/Microsoft.AspNet.Mvc.ModelBinding/ValueProviders/ReadableStringCollectionValueProvider.cs
  51. +6 −2 src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilationOptionsProviderExtension.cs
  52. +1 −1 src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCache.cs
  53. +7 −1 src/Microsoft.AspNet.Mvc.Razor/Compilation/CompilerCacheEntry.cs
  54. +1 −1 src/Microsoft.AspNet.Mvc.Razor/Compilation/DefaultRazorFileSystemCache.cs
  55. +1 −2 src/Microsoft.AspNet.Mvc.Razor/Compilation/RoslynCompilationService.cs
  56. +19 −0 src/Microsoft.AspNet.Mvc.Razor/IBeforeCompileContext.cs
  57. +3 −3 src/Microsoft.AspNet.Mvc.Razor/IViewLocationExpander.cs
  58. +7 −6 src/Microsoft.AspNet.Mvc.Razor/Razor/PreCompileViews/RazorErrorExtensions.cs
  59. +0 −1 src/Microsoft.AspNet.Mvc.Razor/Razor/PreCompileViews/RazorFileInfoCollectionGenerator.cs
  60. +1 −15 src/Microsoft.AspNet.Mvc.Razor/Razor/PreCompileViews/RazorPreCompiler.cs
  61. +3 −1 src/Microsoft.AspNet.Mvc.Razor/RazorPage.cs
  62. +3 −5 src/Microsoft.AspNet.Mvc.Razor/RazorView.cs
  63. +1 −1 src/Microsoft.AspNet.Mvc.TagHelpers/FormTagHelper.cs
  64. +0 −1 src/Microsoft.AspNet.Mvc.TagHelpers/ValidationSummaryTagHelper.cs
  65. +2 −1 src/Microsoft.AspNet.Mvc.WebApiCompatShim/ApiController.cs
  66. +61 −40 src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/CollectionExtensions.cs
  67. +118 −69 src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/DefaultContentNegotiator.cs
  68. +7 −4 src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/FormattingUtilities.cs
  69. +15 −8 src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/IContentNegotiator.cs
  70. +14 −7 src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/MediaTypeConstants.cs
  71. +12 −4 src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/MediaTypeFormatterMatch.cs
  72. +30 −23 src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/MediaTypeHeaderValueExtensions.cs
  73. +17 −14 src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/MediaTypeWithQualityHeaderComparer.cs
  74. +23 −7 src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/ParsedMediaTypeHeaderValue.cs
  75. +8 −8 src/Microsoft.AspNet.Mvc.WebApiCompatShim/ContentNegotiator/StringWithQualityHeaderValueComparer.cs
  76. +1 −1 src/Microsoft.AspNet.Mvc.WebApiCompatShim/FormDataCollectionExtensions.cs
  77. +11 −5 src/Microsoft.AspNet.Mvc.WebApiCompatShim/HttpError.cs
  78. +90 −53 src/Microsoft.AspNet.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageExtensions.cs
  79. +3 −2 src/Microsoft.AspNet.Mvc.WebApiCompatShim/WebApiCompatShimOptionsSetup.cs
  80. +17 −0 src/Microsoft.AspNet.Mvc/IAfterCompileContext.cs
  81. +13 −0 src/Microsoft.AspNet.Mvc/ICompileModule.cs
  82. +8 −16 src/Microsoft.AspNet.Mvc/MvcServices.cs
  83. +5 −21 src/Microsoft.AspNet.Mvc/RazorPreCompileModule.cs
  84. +4 −5 test/Microsoft.AspNet.Mvc.Core.Test/ControllerTests.cs
  85. +1 −1 test/Microsoft.AspNet.Mvc.Core.Test/ViewComponents/ViewViewComponentResultTest.cs
  86. +2 −2 test/Microsoft.AspNet.Mvc.FunctionalTests/ModelBindingTests.cs
  87. +14 −7 test/Microsoft.AspNet.Mvc.WebApiCompatShimTest/TestUtils/MediaTypeConstants.cs
  88. +1 −1 test/WebSites/ModelBindingWebSite/Controllers/FromAttributesController.cs
  89. +1 −1 test/WebSites/ModelBindingWebSite/Models/Department.cs
  90. +1 −1 test/WebSites/ModelBindingWebSite/Models/MixedUser_FromBody.cs
View
@@ -12,6 +12,11 @@
<Analyzers>
<Analyzer AnalyzerId="StyleCop.CSharp.NamingRules">
<Rules>
+ <Rule Name="ConstFieldNamesMustBeginWithUpperCaseLetter">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
<Rule Name="FieldNamesMustNotBeginWithUnderscore">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
@@ -22,6 +27,11 @@
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
+ <Rule Name="StaticReadonlyFieldsMustBeginWithUpperCaseLetter">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
</Rules>
<AnalyzerSettings>
<CollectionProperty Name="Hungarian">
@@ -274,6 +284,11 @@
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
+ <Rule Name="PrefixCallsCorrectly">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
<Rule Name="PrefixLocalCallsWithThis">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
@@ -384,11 +399,21 @@
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
+ <Rule Name="InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
<Rule Name="StaticElementsMustAppearBeforeInstanceElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
+ <Rule Name="StaticReadonlyElementsMustAppearBeforeStaticNonReadonlyElements">
+ <RuleSettings>
+ <BooleanProperty Name="Enabled">False</BooleanProperty>
+ </RuleSettings>
+ </Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
@@ -399,7 +424,7 @@
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
-
+
<!-- Creates a lot of noise with anonymous objects -->
<Rule Name="OpeningCurlyBracketsMustBeSpacedCorrectly">
<RuleSettings>
@@ -19,7 +19,7 @@ private static bool EqualTo([NotNull] this Type[] t1, [NotNull] Type[] t2)
return false;
}
- for (int idx = 0; idx < t1.Length; ++idx)
+ for (var idx = 0; idx < t1.Length; ++idx)
{
if (t1[idx] != t2[idx])
{
@@ -119,7 +119,6 @@ internal string ResolveFilePath(IFileSystem fileSystem)
throw new FileNotFoundException(message, path);
}
- // Internal for unit testing purposes only
/// <summary>
/// Creates a normalized representation of the given <paramref name="path"/>. The default
/// implementation doesn't support files with '\' in the file name and treats the '\' as
@@ -128,6 +127,7 @@ internal string ResolveFilePath(IFileSystem fileSystem)
/// </summary>
/// <param name="path">The path to normalize.</param>
/// <returns>The normalized path.</returns>
+ // Internal for unit testing purposes only
protected internal virtual string NormalizePath([NotNull] string path)
{
// Unix systems support '\' as part of the file name. So '\' is not
@@ -153,13 +153,13 @@ protected internal virtual string NormalizePath([NotNull] string path)
return path.Replace('\\', '/');
}
- // Internal for unit testing purposes only
/// <summary>
/// Determines if the provided path is absolute or relative. The default implementation considers
/// paths starting with '/' to be relative.
/// </summary>
/// <param name="path">The path to examine.</param>
/// <returns>True if the path is absolute.</returns>
+ // Internal for unit testing purposes only
protected internal virtual bool IsPathRooted([NotNull] string path)
{
// We consider paths to be rooted if they start with '<<VolumeLetter>>:' and do
@@ -84,7 +84,7 @@ private static void AddByteToStringBuilder(byte b, StringBuilder builder)
{
builder.Append('%');
- int i = b;
+ var i = b;
AddHexDigitToStringBuilder(i >> 4, builder);
AddHexDigitToStringBuilder(i % 16, builder);
}
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
namespace Microsoft.AspNet.Mvc
{
internal sealed class AntiForgeryToken
@@ -23,7 +23,8 @@ internal sealed class AntiForgeryTokenStore : ITokenStore
public AntiForgeryToken GetCookieToken(HttpContext httpContext)
{
- var contextAccessor = httpContext.RequestServices.GetRequiredService<IContextAccessor<AntiForgeryContext>>();
+ var contextAccessor =
+ httpContext.RequestServices.GetRequiredService<IContextAccessor<AntiForgeryContext>>();
if (contextAccessor.Value != null)
{
return contextAccessor.Value.CookieToken;
@@ -56,7 +57,8 @@ public void SaveCookieToken(HttpContext httpContext, AntiForgeryToken token)
{
// Add the cookie to the request based context.
// This is useful if the cookie needs to be reloaded in the context of the same request.
- var contextAccessor = httpContext.RequestServices.GetRequiredService<IContextAccessor<AntiForgeryContext>>();
+ var contextAccessor =
+ httpContext.RequestServices.GetRequiredService<IContextAccessor<AntiForgeryContext>>();
Debug.Assert(contextAccessor.Value == null, "AntiForgeryContext should be set only once per request.");
contextAccessor.SetValue(new AntiForgeryContext() { CookieToken = token });
@@ -233,7 +233,6 @@ private bool IsIDisposableMethod(MethodInfo methodInfo, TypeInfo typeInfo)
typeInfo.GetRuntimeInterfaceMap(typeof(IDisposable)).TargetMethods[0] == methodInfo);
}
-
/// <summary>
/// Creates an <see cref="ActionModel"/> for the given <see cref="MethodInfo"/>.
/// </summary>
@@ -67,9 +67,8 @@ public IViewEngine ViewEngine
{
if (_viewEngine == null)
{
- _viewEngine = ActionContext?.
- HttpContext?.
- RequestServices.GetRequiredService<ICompositeViewEngine>();
+ _viewEngine =
+ ActionContext?.HttpContext?.RequestServices.GetRequiredService<ICompositeViewEngine>();
}
return _viewEngine;
@@ -797,7 +796,7 @@ public virtual void OnActionExecuted([NotNull] ActionExecutedContext context)
}
/// <summary>
- /// Updates the specified <paramref name="model"/> instance using values from the controller's current
+ /// Updates the specified <paramref name="model"/> instance using values from the controller's current
/// <see cref="IValueProvider"/>.
/// </summary>
/// <typeparam name="TModel">The type of the model object.</typeparam>
@@ -811,7 +810,7 @@ public virtual Task<bool> TryUpdateModelAsync<TModel>([NotNull] TModel model)
}
/// <summary>
- /// Updates the specified <paramref name="model"/> instance using values from the controller's current
+ /// Updates the specified <paramref name="model"/> instance using values from the controller's current
/// <see cref="IValueProvider"/> and a <paramref name="prefix"/>.
/// </summary>
/// <typeparam name="TModel">The type of the model object.</typeparam>
@@ -826,7 +825,7 @@ public virtual Task<bool> TryUpdateModelAsync<TModel>([NotNull] TModel model)
{
if (BindingContextProvider == null)
{
- var message = Resources.FormatPropertyOfTypeCannotBeNull(nameof(BindingContextProvider),
+ var message = Resources.FormatPropertyOfTypeCannotBeNull(nameof(BindingContextProvider),
GetType().FullName);
throw new InvalidOperationException(message);
}
@@ -836,7 +835,7 @@ public virtual Task<bool> TryUpdateModelAsync<TModel>([NotNull] TModel model)
}
/// <summary>
- /// Updates the specified <paramref name="model"/> instance using the <paramref name="valueProvider"/> and a
+ /// Updates the specified <paramref name="model"/> instance using the <paramref name="valueProvider"/> and a
/// <paramref name="prefix"/>.
/// </summary>
/// <typeparam name="TModel">The type of the model object.</typeparam>
@@ -853,7 +852,7 @@ public virtual Task<bool> TryUpdateModelAsync<TModel>([NotNull] TModel model)
{
if (BindingContextProvider == null)
{
- var message = Resources.FormatPropertyOfTypeCannotBeNull(nameof(BindingContextProvider),
+ var message = Resources.FormatPropertyOfTypeCannotBeNull(nameof(BindingContextProvider),
GetType().FullName);
throw new InvalidOperationException(message);
}
@@ -870,14 +869,14 @@ public virtual Task<bool> TryUpdateModelAsync<TModel>([NotNull] TModel model)
}
/// <summary>
- /// Updates the specified <paramref name="model"/> instance using values from the controller's current
+ /// Updates the specified <paramref name="model"/> instance using values from the controller's current
/// <see cref="IValueProvider"/> and a <paramref name="prefix"/>.
/// </summary>
/// <typeparam name="TModel">The type of the model object.</typeparam>
/// <param name="model">The model instance to update.</param>
/// <param name="prefix">The prefix to use when looking up values in the current <see cref="IValueProvider"/>.
/// </param>
- /// <param name="includeExpressions"> <see cref="Expression"/>(s) which represent top-level properties
+ /// <param name="includeExpressions"> <see cref="Expression"/>(s) which represent top-level properties
/// which need to be included for the current model.</param>
/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful</returns>
[NonAction]
@@ -907,7 +906,7 @@ public virtual Task<bool> TryUpdateModelAsync<TModel>([NotNull] TModel model)
}
/// <summary>
- /// Updates the specified <paramref name="model"/> instance using values from the controller's current
+ /// Updates the specified <paramref name="model"/> instance using values from the controller's current
/// <see cref="IValueProvider"/> and a <paramref name="prefix"/>.
/// </summary>
/// <typeparam name="TModel">The type of the model object.</typeparam>
@@ -925,7 +924,7 @@ public virtual Task<bool> TryUpdateModelAsync<TModel>([NotNull] TModel model)
{
if (BindingContextProvider == null)
{
- var message = Resources.FormatPropertyOfTypeCannotBeNull(nameof(BindingContextProvider),
+ var message = Resources.FormatPropertyOfTypeCannotBeNull(nameof(BindingContextProvider),
GetType().FullName);
throw new InvalidOperationException(message);
}
@@ -943,15 +942,15 @@ public virtual Task<bool> TryUpdateModelAsync<TModel>([NotNull] TModel model)
}
/// <summary>
- /// Updates the specified <paramref name="model"/> instance using the <paramref name="valueProvider"/> and a
+ /// Updates the specified <paramref name="model"/> instance using the <paramref name="valueProvider"/> and a
/// <paramref name="prefix"/>.
/// </summary>
/// <typeparam name="TModel">The type of the model object.</typeparam>
/// <param name="model">The model instance to update.</param>
/// <param name="prefix">The prefix to use when looking up values in the <paramref name="valueProvider"/>
/// </param>
/// <param name="valueProvider">The <see cref="IValueProvider"/> used for looking up values.</param>
- /// <param name="includeExpressions"> <see cref="Expression"/>(s) which represent top-level properties
+ /// <param name="includeExpressions"> <see cref="Expression"/>(s) which represent top-level properties
/// which need to be included for the current model.</param>
/// <returns>A <see cref="Task"/> that on completion returns <c>true</c> if the update is successful</returns>
[NonAction]
@@ -964,7 +963,7 @@ public virtual Task<bool> TryUpdateModelAsync<TModel>([NotNull] TModel model)
{
if (BindingContextProvider == null)
{
- var message = Resources.FormatPropertyOfTypeCannotBeNull(nameof(BindingContextProvider),
+ var message = Resources.FormatPropertyOfTypeCannotBeNull(nameof(BindingContextProvider),
GetType().FullName);
throw new InvalidOperationException(message);
}
@@ -982,7 +981,7 @@ public virtual Task<bool> TryUpdateModelAsync<TModel>([NotNull] TModel model)
}
/// <summary>
- /// Updates the specified <paramref name="model"/> instance using the <paramref name="valueProvider"/> and a
+ /// Updates the specified <paramref name="model"/> instance using the <paramref name="valueProvider"/> and a
/// <paramref name="prefix"/>.
/// </summary>
/// <typeparam name="TModel">The type of the model object.</typeparam>
@@ -1002,7 +1001,7 @@ public virtual Task<bool> TryUpdateModelAsync<TModel>([NotNull] TModel model)
{
if (BindingContextProvider == null)
{
- var message = Resources.FormatPropertyOfTypeCannotBeNull(nameof(BindingContextProvider),
+ var message = Resources.FormatPropertyOfTypeCannotBeNull(nameof(BindingContextProvider),
GetType().FullName);
throw new InvalidOperationException(message);
}
@@ -5,8 +5,8 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.AspNet.Mvc.ApplicationModels;
-using Microsoft.AspNet.Mvc.Logging;
using Microsoft.AspNet.Mvc.Filters;
+using Microsoft.AspNet.Mvc.Logging;
using Microsoft.Framework.Logging;
using Microsoft.Framework.OptionsModel;
@@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc
public class DefaultAssemblyProvider : IAssemblyProvider
{
/// <summary>
- /// Gets the set of assembly names that are used as root for discovery of
+ /// Gets the set of assembly names that are used as root for discovery of
/// MVC controllers, view components and views.
/// </summary>
protected virtual HashSet<string> ReferenceAssemblies { get; } = new HashSet<string>(StringComparer.Ordinal)
@@ -44,7 +44,7 @@ public IEnumerable<Assembly> CandidateAssemblies
/// <summary>
/// Returns a list of libraries that references the assemblies in <see cref="ReferenceAssemblies"/>.
- /// By default it returns all assemblies that reference any of the primary MVC assemblies
+ /// By default it returns all assemblies that reference any of the primary MVC assemblies
/// while ignoring MVC assemblies.
/// </summary>
/// <returns>A set of <see cref="ILibraryInformation"/>.</returns>
@@ -87,7 +87,8 @@ private void UpdateParameterMetadata(ModelMetadata metadata, IBinderMetadata bin
foreach (var parameter in parameterMetadata)
{
var parameterType = parameter.ModelType;
- var modelBindingContext = GetModelBindingContext(parameter, actionBindingContext, operationBindingContext);
+ var modelBindingContext =
+ GetModelBindingContext(parameter, actionBindingContext, operationBindingContext);
if (await actionBindingContext.ModelBinder.BindModelAsync(modelBindingContext))
{
arguments[parameter.PropertyName] = modelBindingContext.Model;
@@ -17,7 +17,8 @@ namespace Microsoft.AspNet.Mvc
public class DefaultPropertyBindingPredicateProvider<TModel> : IPropertyBindingPredicateProvider
where TModel : class
{
- private static readonly Func<ModelBindingContext, string, bool> _defaultFilter = (context, propertyName) => true;
+ private static readonly Func<ModelBindingContext, string, bool> _defaultFilter =
+ (context, propertyName) => true;
/// <summary>
/// The prefix which is used while generating the property filter.
@@ -57,7 +58,8 @@ public virtual string Prefix
}
}
- private Func<ModelBindingContext, string, bool> GetPredicateFromExpression(IEnumerable<Expression<Func<TModel, object>>> includeExpressions)
+ private Func<ModelBindingContext, string, bool> GetPredicateFromExpression(
+ IEnumerable<Expression<Func<TModel, object>>> includeExpressions)
{
var expression = ModelBindingHelper.GetIncludePredicateExpression(Prefix, includeExpressions.ToArray());
return expression.Compile();
@@ -45,7 +45,6 @@ public int Order
get { return DefaultOrder.DefaultFrameworkSortOrder; }
}
-
/// <inheritdoc />
public void Invoke(ApiDescriptionProviderContext context, Action callNext)
{
@@ -157,7 +156,8 @@ public void Invoke(ApiDescriptionProviderContext context, Action callNext)
// Process parameters that only appear on the path template if any.
foreach (var templateParameter in templateParameters)
{
- var parameterDescription = GetParameter(parameterDescriptor: null, templateParameter: templateParameter);
+ var parameterDescription =
+ GetParameter(parameterDescriptor: null, templateParameter: templateParameter);
apiDescription.ParameterDescriptions.Add(parameterDescription);
}
}
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
namespace Microsoft.AspNet.Mvc
{
public interface IAuthorizationFilter : IFilter
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
namespace Microsoft.AspNet.Mvc
{
public interface IExceptionFilter : IFilter
@@ -1,7 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
-
namespace Microsoft.AspNet.Mvc
{
public interface IInputFormatterSelector
Oops, something went wrong.

0 comments on commit 6df288b

Please sign in to comment.