diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.csproj b/src/Identity/ApiAuthorization.IdentityServer/src/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.csproj index a04b9bd0b9..e5acbc28ad 100644 --- a/src/Identity/ApiAuthorization.IdentityServer/src/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.csproj +++ b/src/Identity/ApiAuthorization.IdentityServer/src/Microsoft.AspNetCore.ApiAuthorization.IdentityServer.csproj @@ -5,6 +5,7 @@ ASP.NET Core API Authorization package powered by Identity Server. true aspnetcore;apiauth;identity + $(NoWarn.Replace('1591', '')) false diff --git a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiScopeCollection.cs b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiScopeCollection.cs index f4265666b7..4ad0f2e624 100644 --- a/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiScopeCollection.cs +++ b/src/Identity/ApiAuthorization.IdentityServer/src/Options/ApiScopeCollection.cs @@ -8,6 +8,9 @@ using IdentityServer4.Models; namespace Microsoft.AspNetCore.ApiAuthorization.IdentityServer { + /// + /// A collection of . + /// public class ApiScopeCollection : Collection { /// diff --git a/src/Identity/Core/src/Microsoft.AspNetCore.Identity.csproj b/src/Identity/Core/src/Microsoft.AspNetCore.Identity.csproj index c4d2657b63..365e4b5529 100644 --- a/src/Identity/Core/src/Microsoft.AspNetCore.Identity.csproj +++ b/src/Identity/Core/src/Microsoft.AspNetCore.Identity.csproj @@ -1,9 +1,10 @@ - + ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. ASP.NET Core Identity allows you to add login features to your application and makes it easy to customize data about the logged in user. $(DefaultNetCoreTargetFramework) true + $(NoWarn.Replace('1591', '')) true aspnetcore;identity;membership false diff --git a/src/Identity/EntityFrameworkCore/src/Microsoft.AspNetCore.Identity.EntityFrameworkCore.csproj b/src/Identity/EntityFrameworkCore/src/Microsoft.AspNetCore.Identity.EntityFrameworkCore.csproj index 10eca21ec6..c36cbc5ad4 100644 --- a/src/Identity/EntityFrameworkCore/src/Microsoft.AspNetCore.Identity.EntityFrameworkCore.csproj +++ b/src/Identity/EntityFrameworkCore/src/Microsoft.AspNetCore.Identity.EntityFrameworkCore.csproj @@ -1,10 +1,11 @@ - + ASP.NET Core Identity provider that uses Entity Framework Core. netstandard2.1;$(DefaultNetCoreTargetFramework) true aspnetcore;entityframeworkcore;identity;membership + $(NoWarn.Replace('1591', '')) diff --git a/src/Identity/Extensions.Core/src/Microsoft.Extensions.Identity.Core.csproj b/src/Identity/Extensions.Core/src/Microsoft.Extensions.Identity.Core.csproj index adf0a1a68e..f7dba72f73 100644 --- a/src/Identity/Extensions.Core/src/Microsoft.Extensions.Identity.Core.csproj +++ b/src/Identity/Extensions.Core/src/Microsoft.Extensions.Identity.Core.csproj @@ -7,6 +7,7 @@ true true aspnetcore;identity;membership + $(NoWarn.Replace('1591', '')) diff --git a/src/Identity/Extensions.Stores/src/Microsoft.Extensions.Identity.Stores.csproj b/src/Identity/Extensions.Stores/src/Microsoft.Extensions.Identity.Stores.csproj index 367a0069f1..fe54f76d42 100644 --- a/src/Identity/Extensions.Stores/src/Microsoft.Extensions.Identity.Stores.csproj +++ b/src/Identity/Extensions.Stores/src/Microsoft.Extensions.Identity.Stores.csproj @@ -7,6 +7,7 @@ true true aspnetcore;identity;membership + $(NoWarn.Replace('1591', '')) diff --git a/src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj b/src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj index 685ffe67b5..1c054fcbcf 100644 --- a/src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj +++ b/src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj @@ -12,6 +12,7 @@ false true true + $(NoWarn.Replace('1591', '')) true true diff --git a/src/Mvc/Mvc.Abstractions/src/Microsoft.AspNetCore.Mvc.Abstractions.csproj b/src/Mvc/Mvc.Abstractions/src/Microsoft.AspNetCore.Mvc.Abstractions.csproj index b3e599ab25..7ebb5cdcee 100644 --- a/src/Mvc/Mvc.Abstractions/src/Microsoft.AspNetCore.Mvc.Abstractions.csproj +++ b/src/Mvc/Mvc.Abstractions/src/Microsoft.AspNetCore.Mvc.Abstractions.csproj @@ -1,4 +1,4 @@ - + ASP.NET Core MVC abstractions and interfaces for action invocation and dispatching, authorization, action filters, formatters, model binding, routing, validation, and more. @@ -10,6 +10,7 @@ Microsoft.AspNetCore.Mvc.IActionResult aspnetcore;aspnetcoremvc false enable + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.Abstractions/src/ModelBinding/Validation/ValidationStateDictionary.cs b/src/Mvc/Mvc.Abstractions/src/ModelBinding/Validation/ValidationStateDictionary.cs index 2d40811d5c..08a48a4b58 100644 --- a/src/Mvc/Mvc.Abstractions/src/ModelBinding/Validation/ValidationStateDictionary.cs +++ b/src/Mvc/Mvc.Abstractions/src/ModelBinding/Validation/ValidationStateDictionary.cs @@ -25,6 +25,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation _inner = new Dictionary(ReferenceEqualityComparer.Instance); } + /// public ValidationStateEntry? this[object key] { get @@ -134,4 +135,4 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation return ((IDictionary)_inner).GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Analyzers/src/Microsoft.AspNetCore.Mvc.Analyzers.csproj b/src/Mvc/Mvc.Analyzers/src/Microsoft.AspNetCore.Mvc.Analyzers.csproj index 2ece75d8d8..515b894452 100644 --- a/src/Mvc/Mvc.Analyzers/src/Microsoft.AspNetCore.Mvc.Analyzers.csproj +++ b/src/Mvc/Mvc.Analyzers/src/Microsoft.AspNetCore.Mvc.Analyzers.csproj @@ -1,4 +1,4 @@ - + CSharp Analyzers for ASP.NET Core MVC. aspnetcore;aspnetcoremvc @@ -10,6 +10,7 @@ false $(MSBuildProjectName).nuspec enable + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.Api.Analyzers/src/Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj b/src/Mvc/Mvc.Api.Analyzers/src/Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj index d3a6e138f1..fdd30f0dc1 100644 --- a/src/Mvc/Mvc.Api.Analyzers/src/Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj +++ b/src/Mvc/Mvc.Api.Analyzers/src/Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj @@ -1,4 +1,4 @@ - + CSharp Analyzers for ASP.NET Core MVC. aspnetcore;aspnetcoremvc @@ -10,6 +10,7 @@ false $(MSBuildProjectName).nuspec enable + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.ApiExplorer/src/Microsoft.AspNetCore.Mvc.ApiExplorer.csproj b/src/Mvc/Mvc.ApiExplorer/src/Microsoft.AspNetCore.Mvc.ApiExplorer.csproj index 11be402c60..1e2a38699c 100644 --- a/src/Mvc/Mvc.ApiExplorer/src/Microsoft.AspNetCore.Mvc.ApiExplorer.csproj +++ b/src/Mvc/Mvc.ApiExplorer/src/Microsoft.AspNetCore.Mvc.ApiExplorer.csproj @@ -1,4 +1,4 @@ - + ASP.NET Core MVC API explorer functionality for discovering metadata such as the list of controllers and actions, and their URLs and allowed HTTP methods. @@ -7,6 +7,7 @@ true aspnetcore;aspnetcoremvc false + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/AttributeRouteModel.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/AttributeRouteModel.cs index 9c82325672..e595240acc 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/AttributeRouteModel.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/AttributeRouteModel.cs @@ -249,11 +249,24 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels return result.Substring(startIndex, subStringLength); } + /// + /// Replaces the tokens in the template with the provided values. + /// + /// The template. + /// The token values to use. + /// A new string with the replaced values. public static string ReplaceTokens(string template, IDictionary values) { return ReplaceTokens(template, values, routeTokenTransformer: null); } + /// + /// Replaces the tokens in the template with the provided values and route token transformer. + /// + /// The template. + /// The token values to use. + /// The route token transformer. + /// A new string with the replaced values. public static string ReplaceTokens(string template, IDictionary values, IOutboundParameterTransformer routeTokenTransformer) { var builder = new StringBuilder(); @@ -464,4 +477,4 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels SeenRight = 4, } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/ControllerModel.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/ControllerModel.cs index 597a5f63c8..52f655bae0 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/ControllerModel.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/ControllerModel.cs @@ -12,9 +12,17 @@ using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Mvc.ApplicationModels { + /// + /// A model for configuring controllers. + /// [DebuggerDisplay("{DisplayName}")] public class ControllerModel : ICommonModel, IFilterModel, IApiExplorerModel { + /// + /// Initializes a new instance of . + /// + /// The type of the controller. + /// The attributes. public ControllerModel( TypeInfo controllerType, IReadOnlyList attributes) @@ -41,6 +49,10 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels Selectors = new List(); } + /// + /// Initializes a new instance of . + /// + /// The other controller model. public ControllerModel(ControllerModel other) { if (other == null) @@ -85,8 +97,14 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels /// public ApiExplorerModel ApiExplorer { get; set; } + /// + /// Gets or sets the of this controller. + /// public ApplicationModel Application { get; set; } + /// + /// The attributes of this controller. + /// public IReadOnlyList Attributes { get; } MemberInfo ICommonModel.MemberInfo => ControllerType; @@ -94,7 +112,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels string ICommonModel.Name => ControllerName; /// - /// The name of this controller. + /// Gets or sets the name of this controller. /// public string ControllerName { get; set; } @@ -103,8 +121,14 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels /// public TypeInfo ControllerType { get; } + /// + /// The properties of this controller. + /// public IList ControllerProperties { get; } + /// + /// The filter metadata of this controller. + /// public IList Filters { get; } /// @@ -127,6 +151,9 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels /// public IDictionary Properties { get; } + /// + /// The selector models of this controller.. + /// public IList Selectors { get; } /// diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/IApiExplorerModel.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/IApiExplorerModel.cs index c5e36ac038..6d3705e6d9 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/IApiExplorerModel.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/IApiExplorerModel.cs @@ -3,8 +3,14 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels { + /// + /// An interface that allows access to an ApiExplorerModel. + /// public interface IApiExplorerModel { + /// + /// The ApiExporerModel. + /// ApiExplorerModel ApiExplorer { get; set; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/IBindingModel.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/IBindingModel.cs index e57ff5589c..0ed6a5a1ed 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/IBindingModel.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/IBindingModel.cs @@ -5,8 +5,14 @@ using Microsoft.AspNetCore.Mvc.ModelBinding; namespace Microsoft.AspNetCore.Mvc.ApplicationModels { + /// + /// An interface which is used to represent a something with a . + /// public interface IBindingModel { + /// + /// The . + /// BindingInfo BindingInfo { get; set; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/ICommonModel.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/ICommonModel.cs index 0fc83aca3e..a495fce0f3 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/ICommonModel.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/ICommonModel.cs @@ -6,10 +6,24 @@ using System.Reflection; namespace Microsoft.AspNetCore.Mvc.ApplicationModels { + /// + /// ICommonModel interface. + /// public interface ICommonModel : IPropertyModel { + /// + /// The attributes. + /// IReadOnlyList Attributes { get; } + + /// + /// The MemberInfo. + /// MemberInfo MemberInfo { get; } + + /// + /// The name. + /// string Name { get; } } } diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/IFilterModel.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/IFilterModel.cs index 98f89df0a0..22f8a7d1fb 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/IFilterModel.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/IFilterModel.cs @@ -6,8 +6,14 @@ using Microsoft.AspNetCore.Mvc.Filters; namespace Microsoft.AspNetCore.Mvc.ApplicationModels { + /// + /// Model that has a list of . + /// public interface IFilterModel { + /// + /// List of . + /// IList Filters { get; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/IParameterModelConvention.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/IParameterModelConvention.cs index eddbbe383c..76924e27ab 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/IParameterModelConvention.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/IParameterModelConvention.cs @@ -15,6 +15,10 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels /// public interface IParameterModelConvention { + /// + /// Called to apply the convention to the . + /// + /// The . void Apply(ParameterModel parameter); } } diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/IPropertyModel.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/IPropertyModel.cs index 5fbdb4567a..48cd751abc 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/IPropertyModel.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/IPropertyModel.cs @@ -5,8 +5,14 @@ using System.Collections.Generic; namespace Microsoft.AspNetCore.Mvc.ApplicationModels { + /// + /// An interface which is used to represent something with properties. + /// public interface IPropertyModel { + /// + /// The properties. + /// IDictionary Properties { get; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/InferParameterBindingInfoConvention.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/InferParameterBindingInfoConvention.cs index b83461b90e..ddecab8432 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/InferParameterBindingInfoConvention.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/InferParameterBindingInfoConvention.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -25,14 +25,27 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels { private readonly IModelMetadataProvider _modelMetadataProvider; + /// + /// Initializes a new instance of . + /// + /// The model metadata provider. public InferParameterBindingInfoConvention( IModelMetadataProvider modelMetadataProvider) { _modelMetadataProvider = modelMetadataProvider ?? throw new ArgumentNullException(nameof(modelMetadataProvider)); } + /// + /// Called to determine whether the action should apply. + /// + /// The action in question. + /// if the action should apply. protected virtual bool ShouldApply(ActionModel action) => true; + /// + /// Called to apply the convention to the . + /// + /// The . public void Apply(ActionModel action) { if (action == null) diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/InvalidModelStateFilterConvention.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/InvalidModelStateFilterConvention.cs index 6d15ae2d58..cb3a865636 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/InvalidModelStateFilterConvention.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/InvalidModelStateFilterConvention.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -15,6 +15,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels { private readonly ModelStateInvalidFilterFactory _filterFactory = new ModelStateInvalidFilterFactory(); + /// public void Apply(ActionModel action) { if (action == null) @@ -30,6 +31,11 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels action.Filters.Add(_filterFactory); } + /// + /// Called to determine whether the action should apply. + /// + /// The action in question. + /// if the action should apply. protected virtual bool ShouldApply(ActionModel action) => true; } } diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/ParameterModel.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/ParameterModel.cs index f473ab94f4..a4d5689d84 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/ParameterModel.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/ParameterModel.cs @@ -9,9 +9,17 @@ using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Mvc.ApplicationModels { + /// + /// A type that represents a paramater. + /// [DebuggerDisplay("ParameterModel: Name={ParameterName}")] public class ParameterModel : ParameterModelBase, ICommonModel { + /// + /// Initializes a new . + /// + /// The parameter info. + /// The attributes. public ParameterModel( ParameterInfo parameterInfo, IReadOnlyList attributes) @@ -20,6 +28,10 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels ParameterInfo = parameterInfo ?? throw new ArgumentNullException(nameof(parameterInfo)); } + /// + /// Initializes a new . + /// + /// The parameter model to copy. public ParameterModel(ParameterModel other) : base(other) { @@ -32,22 +44,40 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels ParameterInfo = other.ParameterInfo; } + /// + /// The . + /// public ActionModel Action { get; set; } + /// + /// The properties. + /// public new IDictionary Properties => base.Properties; + /// + /// The attributes. + /// public new IReadOnlyList Attributes => base.Attributes; MemberInfo ICommonModel.MemberInfo => ParameterInfo.Member; + /// + /// The . + /// public ParameterInfo ParameterInfo { get; } + /// + /// The parameter name. + /// public string ParameterName { get => Name; set => Name = value; } + /// + /// The display name. + /// public string DisplayName { get diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/ParameterModelBase.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/ParameterModelBase.cs index 7937d8b3c7..8458811001 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/ParameterModelBase.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/ParameterModelBase.cs @@ -15,6 +15,11 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels /// public abstract class ParameterModelBase : IBindingModel { + /// + /// Initializes a new instance of a . + /// + /// The type. + /// The attributes. protected ParameterModelBase( Type parameterType, IReadOnlyList attributes) @@ -25,6 +30,10 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels Properties = new Dictionary(); } + /// + /// Copy constructor. + /// + /// The other instance to copy protected ParameterModelBase(ParameterModelBase other) { if (other == null) @@ -39,14 +48,29 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels Properties = new Dictionary(other.Properties); } + /// + /// The attributes. + /// public IReadOnlyList Attributes { get; } + /// + /// The properties. + /// public IDictionary Properties { get; } + /// + /// The type. + /// public Type ParameterType { get; } + /// + /// The name. + /// public string Name { get; protected set; } + /// + /// The . + /// public BindingInfo BindingInfo { get; set; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/PropertyModel.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/PropertyModel.cs index 8f26d0648a..eeb2e0ac92 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/PropertyModel.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/PropertyModel.cs @@ -52,12 +52,20 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels MemberInfo ICommonModel.MemberInfo => PropertyInfo; + /// public new IDictionary Properties => base.Properties; + /// public new IReadOnlyList Attributes => base.Attributes; + /// + /// The . + /// public PropertyInfo PropertyInfo { get; } + /// + /// The name of the property. + /// public string PropertyName { get => Name; diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/RouteTokenTransformerConvention.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/RouteTokenTransformerConvention.cs index 44492420c1..d7c4e78f5f 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/RouteTokenTransformerConvention.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/RouteTokenTransformerConvention.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -29,6 +29,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels _parameterTransformer = parameterTransformer; } + /// public void Apply(ActionModel action) { if (ShouldApply(action)) @@ -37,6 +38,11 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels } } + /// + /// Called to determine whether an action should apply. + /// + /// The . + /// if the the action should apply. protected virtual bool ShouldApply(ActionModel action) => true; } } diff --git a/src/Mvc/Mvc.Core/src/ApplicationModels/SelectorModel.cs b/src/Mvc/Mvc.Core/src/ApplicationModels/SelectorModel.cs index 5ff6d1072a..0ad8933ddb 100644 --- a/src/Mvc/Mvc.Core/src/ApplicationModels/SelectorModel.cs +++ b/src/Mvc/Mvc.Core/src/ApplicationModels/SelectorModel.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -7,14 +7,24 @@ using Microsoft.AspNetCore.Mvc.ActionConstraints; namespace Microsoft.AspNetCore.Mvc.ApplicationModels { + /// + /// A type that represents a selector. + /// public class SelectorModel { + /// + /// Intializes a new . + /// public SelectorModel() { ActionConstraints = new List(); EndpointMetadata = new List(); } + /// + /// Intializes a new . + /// + /// The to copy from. public SelectorModel(SelectorModel other) { if (other == null) @@ -31,8 +41,14 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels } } + /// + /// The . + /// public AttributeRouteModel AttributeRouteModel { get; set; } + /// + /// The list of . + /// public IList ActionConstraints { get; } /// diff --git a/src/Mvc/Mvc.Core/src/ConsumesAttribute.cs b/src/Mvc/Mvc.Core/src/ConsumesAttribute.cs index 14bcf68626..150781c49c 100644 --- a/src/Mvc/Mvc.Core/src/ConsumesAttribute.cs +++ b/src/Mvc/Mvc.Core/src/ConsumesAttribute.cs @@ -25,6 +25,10 @@ namespace Microsoft.AspNetCore.Mvc IConsumesActionConstraint, IApiRequestMetadataProvider { + /// + /// The order for consumes attribute. + /// + /// Defaults to 200 public static readonly int ConsumesActionConstraintOrder = 200; /// @@ -229,4 +233,4 @@ namespace Microsoft.AspNetCore.Mvc } } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/ContentResult.cs b/src/Mvc/Mvc.Core/src/ContentResult.cs index 6fd602d5c3..85cb444503 100644 --- a/src/Mvc/Mvc.Core/src/ContentResult.cs +++ b/src/Mvc/Mvc.Core/src/ContentResult.cs @@ -8,6 +8,9 @@ using Microsoft.Extensions.DependencyInjection; namespace Microsoft.AspNetCore.Mvc { + /// + /// A that when executed will produce a response with content. + /// public class ContentResult : ActionResult, IStatusCodeActionResult { /// @@ -25,6 +28,7 @@ namespace Microsoft.AspNetCore.Mvc /// public int? StatusCode { get; set; } + /// public override Task ExecuteResultAsync(ActionContext context) { if (context == null) diff --git a/src/Mvc/Mvc.Core/src/ControllerBase.cs b/src/Mvc/Mvc.Core/src/ControllerBase.cs index 5903c4126b..490f594287 100644 --- a/src/Mvc/Mvc.Core/src/ControllerBase.cs +++ b/src/Mvc/Mvc.Core/src/ControllerBase.cs @@ -191,6 +191,9 @@ namespace Microsoft.AspNetCore.Mvc } } + /// + /// Gets or sets the . + /// public ProblemDetailsFactory ProblemDetailsFactory { get diff --git a/src/Mvc/Mvc.Core/src/Controllers/ControllerActionDescriptor.cs b/src/Mvc/Mvc.Core/src/Controllers/ControllerActionDescriptor.cs index 3cee82963a..1592a412d0 100644 --- a/src/Mvc/Mvc.Core/src/Controllers/ControllerActionDescriptor.cs +++ b/src/Mvc/Mvc.Core/src/Controllers/ControllerActionDescriptor.cs @@ -10,17 +10,33 @@ using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Mvc.Controllers { + /// + /// A descriptor for an action of a controller. + /// [DebuggerDisplay("{DisplayName}")] public class ControllerActionDescriptor : ActionDescriptor { + /// + /// The name of the controller. + /// public string ControllerName { get; set; } + /// + /// The name of the action. + /// public virtual string ActionName { get; set; } + /// + /// The . + /// public MethodInfo MethodInfo { get; set; } + /// + /// The of the controller.. + /// public TypeInfo ControllerTypeInfo { get; set; } + /// public override string DisplayName { get diff --git a/src/Mvc/Mvc.Core/src/Controllers/ControllerActivatorProvider.cs b/src/Mvc/Mvc.Core/src/Controllers/ControllerActivatorProvider.cs index 47375242c9..61e1ad137e 100644 --- a/src/Mvc/Mvc.Core/src/Controllers/ControllerActivatorProvider.cs +++ b/src/Mvc/Mvc.Core/src/Controllers/ControllerActivatorProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -17,6 +17,10 @@ namespace Microsoft.AspNetCore.Mvc.Controllers private readonly Func _controllerActivatorCreate; private readonly Action _controllerActivatorRelease; + /// + /// Initializes a new instance of . + /// + /// A which is delegated to when not the default implementation. public ControllerActivatorProvider(IControllerActivator controllerActivator) { if (controllerActivator == null) @@ -32,6 +36,7 @@ namespace Microsoft.AspNetCore.Mvc.Controllers } } + /// public Func CreateActivator(ControllerActionDescriptor descriptor) { if (descriptor == null) @@ -57,6 +62,7 @@ namespace Microsoft.AspNetCore.Mvc.Controllers return controllerContext => typeActivator(controllerContext.HttpContext.RequestServices, arguments: null); } + /// public Action CreateReleaser(ControllerActionDescriptor descriptor) { if (descriptor == null) diff --git a/src/Mvc/Mvc.Core/src/DefaultApiConventions.cs b/src/Mvc/Mvc.Core/src/DefaultApiConventions.cs index 281e78461f..c8eaad6b3b 100644 --- a/src/Mvc/Mvc.Core/src/DefaultApiConventions.cs +++ b/src/Mvc/Mvc.Core/src/DefaultApiConventions.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using Microsoft.AspNetCore.Http; @@ -6,9 +6,16 @@ using Microsoft.AspNetCore.Mvc.ApiExplorer; namespace Microsoft.AspNetCore.Mvc { + /// + /// Default api conventions. + /// public static class DefaultApiConventions { #region GET + /// + /// Get convention. + /// + /// [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesDefaultResponseType] @@ -18,6 +25,10 @@ namespace Microsoft.AspNetCore.Mvc [ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object id) { } + /// + /// Find convention. + /// + /// [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesDefaultResponseType] @@ -29,6 +40,10 @@ namespace Microsoft.AspNetCore.Mvc { } #endregion + /// + /// Post convention. + /// + /// #region POST [ProducesResponseType(StatusCodes.Status201Created)] [ProducesResponseType(StatusCodes.Status400BadRequest)] @@ -39,6 +54,10 @@ namespace Microsoft.AspNetCore.Mvc [ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object model) { } + /// + /// Create convention. + /// + /// [ProducesResponseType(StatusCodes.Status201Created)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesDefaultResponseType] @@ -51,6 +70,11 @@ namespace Microsoft.AspNetCore.Mvc #endregion #region PUT + /// + /// Put convention. + /// + /// + /// [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status400BadRequest)] @@ -65,6 +89,11 @@ namespace Microsoft.AspNetCore.Mvc [ApiConventionTypeMatch(ApiConventionTypeMatchBehavior.Any)] object model) { } + /// + /// Edit convention. + /// + /// + /// [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status400BadRequest)] @@ -80,6 +109,11 @@ namespace Microsoft.AspNetCore.Mvc object model) { } + /// + /// Update convention. + /// + /// + /// [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status400BadRequest)] @@ -97,6 +131,10 @@ namespace Microsoft.AspNetCore.Mvc #endregion #region DELETE + /// + /// Delete convention. + /// + /// [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] [ProducesResponseType(StatusCodes.Status400BadRequest)] diff --git a/src/Mvc/Mvc.Core/src/Diagnostics/EventData.cs b/src/Mvc/Mvc.Core/src/Diagnostics/EventData.cs index b9d064c314..3772e93653 100644 --- a/src/Mvc/Mvc.Core/src/Diagnostics/EventData.cs +++ b/src/Mvc/Mvc.Core/src/Diagnostics/EventData.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -7,11 +7,22 @@ using System.Collections.Generic; namespace Microsoft.AspNetCore.Mvc.Diagnostics { + /// + /// A base class that for an event. + /// public abstract class EventData : IReadOnlyList> { + /// + /// The namespace of the event. + /// protected const string EventNamespace = "Microsoft.AspNetCore.Mvc."; + /// + /// The event count. + /// protected abstract int Count { get; } + + /// protected abstract KeyValuePair this[int index] { get; } int IReadOnlyCollection>.Count => Count; @@ -25,6 +36,9 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + /// + /// A struct that represents an Enumerator + /// public struct Enumerator : IEnumerator> { private readonly EventData _eventData; @@ -32,6 +46,9 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics private int _index; + /// + /// Current keyvalue pair. + /// public KeyValuePair Current { get; private set; } internal Enumerator(EventData eventData) @@ -42,6 +59,7 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Current = default; } + /// public bool MoveNext() { var index = _index + 1; @@ -56,6 +74,7 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics return true; } + /// public void Dispose() { } object IEnumerator.Current => Current; void IEnumerator.Reset() => throw new NotSupportedException(); diff --git a/src/Mvc/Mvc.Core/src/Diagnostics/MvcDiagnostics.cs b/src/Mvc/Mvc.Core/src/Diagnostics/MvcDiagnostics.cs index b388140a57..7d818fdaf0 100644 --- a/src/Mvc/Mvc.Core/src/Diagnostics/MvcDiagnostics.cs +++ b/src/Mvc/Mvc.Core/src/Diagnostics/MvcDiagnostics.cs @@ -10,9 +10,22 @@ using Microsoft.AspNetCore.Routing; namespace Microsoft.AspNetCore.Mvc.Diagnostics { + /// + /// An that occurs before an action. + /// public sealed class BeforeActionEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeAction"; + + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforeActionEventData(ActionDescriptor actionDescriptor, HttpContext httpContext, RouteData routeData) { ActionDescriptor = actionDescriptor; @@ -20,12 +33,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics RouteData = routeData; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public HttpContext HttpContext { get; } + + /// + /// The route data. + /// public RouteData RouteData { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -35,10 +61,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after an action. + /// public sealed class AfterActionEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterAction"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterActionEventData(ActionDescriptor actionDescriptor, HttpContext httpContext, RouteData routeData) { ActionDescriptor = actionDescriptor; @@ -46,12 +84,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics RouteData = routeData; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public HttpContext HttpContext { get; } + + /// + /// The route data. + /// public RouteData RouteData { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -61,10 +112,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before . + /// public sealed class BeforeAuthorizationFilterOnAuthorizationEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeOnAuthorization"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforeAuthorizationFilterOnAuthorizationEventData(ActionDescriptor actionDescriptor, AuthorizationFilterContext authorizationContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -72,12 +135,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The authorization context. + /// public AuthorizationFilterContext AuthorizationContext { get; } + + /// + /// The authorization filter. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -87,10 +163,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after . + /// public sealed class AfterAuthorizationFilterOnAuthorizationEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterOnAuthorization"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterAuthorizationFilterOnAuthorizationEventData(ActionDescriptor actionDescriptor, AuthorizationFilterContext authorizationContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -98,12 +186,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The authorization context. + /// public AuthorizationFilterContext AuthorizationContext { get; } + + /// + /// The authorization filter. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -113,10 +214,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before execution. + /// public sealed class BeforeResourceFilterOnResourceExecutionEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeOnResourceExecution"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforeResourceFilterOnResourceExecutionEventData(ActionDescriptor actionDescriptor, ResourceExecutingContext resourceExecutingContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -124,12 +237,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ResourceExecutingContext ResourceExecutingContext { get; } + + /// + /// The resource filter that will run. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -139,10 +265,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after execution. + /// public sealed class AfterResourceFilterOnResourceExecutionEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterOnResourceExecution"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterResourceFilterOnResourceExecutionEventData(ActionDescriptor actionDescriptor, ResourceExecutedContext resourceExecutedContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -150,12 +288,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ResourceExecutedContext ResourceExecutedContext { get; } + + /// + /// The resource filter that will be run. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -165,10 +316,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before . + /// public sealed class BeforeResourceFilterOnResourceExecutingEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeOnResourceExecuting"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforeResourceFilterOnResourceExecutingEventData(ActionDescriptor actionDescriptor, ResourceExecutingContext resourceExecutingContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -176,12 +339,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ResourceExecutingContext ResourceExecutingContext { get; } + + /// + /// The resource filter that will run. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -191,10 +367,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after . + /// public sealed class AfterResourceFilterOnResourceExecutingEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterOnResourceExecuting"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterResourceFilterOnResourceExecutingEventData(ActionDescriptor actionDescriptor, ResourceExecutingContext resourceExecutingContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -202,12 +390,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ResourceExecutingContext ResourceExecutingContext { get; } + + /// + /// The resource filter that ran. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -217,10 +418,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before . + /// public sealed class BeforeResourceFilterOnResourceExecutedEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeOnResourceExecuted"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforeResourceFilterOnResourceExecutedEventData(ActionDescriptor actionDescriptor, ResourceExecutedContext resourceExecutedContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -228,12 +441,26 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ResourceExecutedContext ResourceExecutedContext { get; } + + /// + /// The resource filter that will run. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -243,10 +470,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after . + /// public sealed class AfterResourceFilterOnResourceExecutedEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterOnResourceExecuted"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterResourceFilterOnResourceExecutedEventData(ActionDescriptor actionDescriptor, ResourceExecutedContext resourceExecutedContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -254,12 +493,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The resource context. + /// public ResourceExecutedContext ResourceExecutedContext { get; } + + /// + /// The filter. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -269,10 +521,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before . + /// public sealed class BeforeExceptionFilterOnException : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeOnException"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforeExceptionFilterOnException(ActionDescriptor actionDescriptor, ExceptionContext exceptionContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -280,12 +544,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ExceptionContext ExceptionContext { get; } + + /// + /// The exception filter that will run. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -295,10 +572,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after . + /// public sealed class AfterExceptionFilterOnExceptionEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterOnException"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterExceptionFilterOnExceptionEventData(ActionDescriptor actionDescriptor, ExceptionContext exceptionContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -306,12 +595,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The exception context. + /// public ExceptionContext ExceptionContext { get; } + + /// + /// The exception filter that ran. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -321,10 +623,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before execution. + /// public sealed class BeforeActionFilterOnActionExecutionEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeOnActionExecution"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforeActionFilterOnActionExecutionEventData(ActionDescriptor actionDescriptor, ActionExecutingContext actionExecutingContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -332,12 +646,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action that will run.. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The action context. + /// public ActionExecutingContext ActionExecutingContext { get; } + + /// + /// The action filter that will run. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -347,10 +674,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after execution. + /// public sealed class AfterActionFilterOnActionExecutionEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterOnActionExecution"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterActionFilterOnActionExecutionEventData(ActionDescriptor actionDescriptor, ActionExecutedContext actionExecutedContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -358,12 +697,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action that ran. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The action executed context. + /// public ActionExecutedContext ActionExecutedContext { get; } + + /// + /// The action filter that ran. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -373,10 +725,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before . + /// public sealed class BeforeActionFilterOnActionExecutingEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeOnActionExecuting"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforeActionFilterOnActionExecutingEventData(ActionDescriptor actionDescriptor, ActionExecutingContext actionExecutingContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -384,12 +748,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The action context. + /// public ActionExecutingContext ActionExecutingContext { get; } + + /// + /// The action filter that will run. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -399,10 +776,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after . + /// public sealed class AfterActionFilterOnActionExecutingEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterOnActionExecuting"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterActionFilterOnActionExecutingEventData(ActionDescriptor actionDescriptor, ActionExecutingContext actionExecutingContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -410,12 +799,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ActionExecutingContext ActionExecutingContext { get; } + + /// + /// The action filter. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -425,10 +827,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before . + /// public sealed class BeforeActionFilterOnActionExecutedEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeOnActionExecuted"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforeActionFilterOnActionExecutedEventData(ActionDescriptor actionDescriptor, ActionExecutedContext actionExecutedContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -436,12 +850,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ActionExecutedContext ActionExecutedContext { get; } + + /// + /// The action filter. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -451,10 +878,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after . + /// public sealed class AfterActionFilterOnActionExecutedEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterOnActionExecuted"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterActionFilterOnActionExecutedEventData(ActionDescriptor actionDescriptor, ActionExecutedContext actionExecutedContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -462,12 +901,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ActionExecutedContext ActionExecutedContext { get; } + + /// + /// The action filter. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -477,10 +929,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before an controller action method. + /// public sealed class BeforeControllerActionMethodEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeControllerActionMethod"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The arguments to the action. + /// The controller. public BeforeControllerActionMethodEventData(ActionContext actionContext, IReadOnlyDictionary actionArguments, object controller) { ActionContext = actionContext; @@ -488,12 +952,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Controller = controller; } + /// + /// The action context. + /// public ActionContext ActionContext { get; } + + /// + /// The action arguments. + /// public IReadOnlyDictionary ActionArguments { get; } + + /// + /// The controller. + /// public object Controller { get; } + /// protected sealed override int Count => 3; + /// protected sealed override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionContext), ActionContext), @@ -503,10 +980,23 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after an controller action method. + /// public sealed class AfterControllerActionMethodEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterControllerActionMethod"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The arguments to the action. + /// The controller. + /// The . public AfterControllerActionMethodEventData(ActionContext actionContext, IReadOnlyDictionary arguments, object controller, IActionResult result) { ActionContext = actionContext; @@ -515,13 +1005,30 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Result = result; } + /// + /// The context. + /// public ActionContext ActionContext { get; } + + /// + /// The arguments. + /// public IReadOnlyDictionary Arguments { get; } + + /// + /// The controller. + /// public object Controller { get; } + + /// + /// The result. + /// public IActionResult Result { get; } + /// protected override int Count => 4; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionContext), ActionContext), @@ -532,10 +1039,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before a ResultFilter's OnResultExecution + /// public sealed class BeforeResultFilterOnResultExecutionEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeOnResultExecution"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforeResultFilterOnResultExecutionEventData(ActionDescriptor actionDescriptor, ResultExecutingContext resultExecutingContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -543,12 +1062,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ResultExecutingContext ResultExecutingContext { get; } + + /// + /// The result filter. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -558,10 +1090,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after a ResultFilter's OnResultExecution + /// public sealed class AfterResultFilterOnResultExecutionEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterOnResultExecution"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterResultFilterOnResultExecutionEventData(ActionDescriptor actionDescriptor, ResultExecutedContext resultExecutedContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -569,12 +1113,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ResultExecutedContext ResultExecutedContext { get; } + + /// + /// The result filter. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -584,10 +1141,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before . + /// public sealed class BeforeResultFilterOnResultExecutingEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeOnResultExecuting"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforeResultFilterOnResultExecutingEventData(ActionDescriptor actionDescriptor, ResultExecutingContext resultExecutingContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -595,12 +1164,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ResultExecutingContext ResultExecutingContext { get; } + + /// + /// The result filter. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -610,10 +1192,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after . + /// public sealed class AfterResultFilterOnResultExecutingEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterOnResultExecuting"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterResultFilterOnResultExecutingEventData(ActionDescriptor actionDescriptor, ResultExecutingContext resultExecutingContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -621,12 +1215,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ResultExecutingContext ResultExecutingContext { get; } + + /// + /// The filter. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -636,10 +1243,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before . + /// public sealed class BeforeResultFilterOnResultExecutedEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeOnResultExecuted"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforeResultFilterOnResultExecutedEventData(ActionDescriptor actionDescriptor, ResultExecutedContext resultExecutedContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -647,12 +1266,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The context. + /// public ResultExecutedContext ResultExecutedContext { get; } + + /// + /// The result filter. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -662,10 +1294,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after . + /// public sealed class AfterResultFilterOnResultExecutedEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterOnResultExecuted"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterResultFilterOnResultExecutedEventData(ActionDescriptor actionDescriptor, ResultExecutedContext resultExecutedContext, IFilterMetadata filter) { ActionDescriptor = actionDescriptor; @@ -673,12 +1317,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The action. + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The result executed context. + /// public ResultExecutedContext ResultExecutedContext { get; } + + /// + /// The filter that ran. + /// public IFilterMetadata Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -688,21 +1345,41 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before an action result is invoked. + /// public sealed class BeforeActionResultEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "BeforeActionResult"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . public BeforeActionResultEventData(ActionContext actionContext, IActionResult result) { ActionContext = actionContext; Result = result; } + /// + /// The action context. + /// public ActionContext ActionContext { get; } + + /// + /// The action result. + /// public IActionResult Result { get; } + /// protected override int Count => 2; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionContext), ActionContext), @@ -711,21 +1388,41 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after an action result is invoked. + /// public sealed class AfterActionResultEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "AfterActionResult"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . public AfterActionResultEventData(ActionContext actionContext, IActionResult result) { ActionContext = actionContext; Result = result; } + /// + /// The action context. + /// public ActionContext ActionContext { get; } + + /// + /// The result. + /// public IActionResult Result { get; } + /// protected override int Count => 2; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionContext), ActionContext), @@ -733,4 +1430,4 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics _ => throw new IndexOutOfRangeException(nameof(index)) }; } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/Filters/FilterCollection.cs b/src/Mvc/Mvc.Core/src/Filters/FilterCollection.cs index bb0f56ef9f..acea437b9c 100644 --- a/src/Mvc/Mvc.Core/src/Filters/FilterCollection.cs +++ b/src/Mvc/Mvc.Core/src/Filters/FilterCollection.cs @@ -7,6 +7,9 @@ using Microsoft.AspNetCore.Mvc.Core; namespace Microsoft.AspNetCore.Mvc.Filters { + /// + /// A collection of . + /// public class FilterCollection : Collection { /// diff --git a/src/Mvc/Mvc.Core/src/Filters/FilterScope.cs b/src/Mvc/Mvc.Core/src/Filters/FilterScope.cs index e687d3975c..57552637c4 100644 --- a/src/Mvc/Mvc.Core/src/Filters/FilterScope.cs +++ b/src/Mvc/Mvc.Core/src/Filters/FilterScope.cs @@ -14,10 +14,29 @@ namespace Microsoft.AspNetCore.Mvc.Filters /// public static class FilterScope { + /// + /// First filter scope. + /// public static readonly int First = 0; + + /// + /// Global filter scope. + /// public static readonly int Global = 10; + + /// + /// Controller filter scope. + /// public static readonly int Controller = 20; + + /// + /// Action filter scope. + /// public static readonly int Action = 30; + + /// + /// Last filter scope. + /// public static readonly int Last = 100; } } diff --git a/src/Mvc/Mvc.Core/src/Filters/MiddlewareFilterAttribute.cs b/src/Mvc/Mvc.Core/src/Filters/MiddlewareFilterAttribute.cs index be4b3f8270..a3a50e035b 100644 --- a/src/Mvc/Mvc.Core/src/Filters/MiddlewareFilterAttribute.cs +++ b/src/Mvc/Mvc.Core/src/Filters/MiddlewareFilterAttribute.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -28,6 +28,9 @@ namespace Microsoft.AspNetCore.Mvc ConfigurationType = configurationType; } + /// + /// The type which configures a middleware pipeline. + /// public Type ConfigurationType { get; } /// diff --git a/src/Mvc/Mvc.Core/src/Formatters/MediaType.cs b/src/Mvc/Mvc.Core/src/Formatters/MediaType.cs index 8e7103d588..30bbc17423 100644 --- a/src/Mvc/Mvc.Core/src/Formatters/MediaType.cs +++ b/src/Mvc/Mvc.Core/src/Formatters/MediaType.cs @@ -374,11 +374,21 @@ namespace Microsoft.AspNetCore.Mvc.Formatters return builder.ToString(); } + /// + /// Get an encoding for a mediaType. + /// + /// The mediaType. + /// The encoding. public static Encoding GetEncoding(string mediaType) { return GetEncoding(new StringSegment(mediaType)); } + /// + /// Get an encoding for a mediaType. + /// + /// The mediaType. + /// The encoding. public static Encoding GetEncoding(StringSegment mediaType) { var parsedMediaType = new MediaType(mediaType); diff --git a/src/Mvc/Mvc.Core/src/Formatters/StringOutputFormatter.cs b/src/Mvc/Mvc.Core/src/Formatters/StringOutputFormatter.cs index 52c387d137..9f95f556d1 100644 --- a/src/Mvc/Mvc.Core/src/Formatters/StringOutputFormatter.cs +++ b/src/Mvc/Mvc.Core/src/Formatters/StringOutputFormatter.cs @@ -13,6 +13,9 @@ namespace Microsoft.AspNetCore.Mvc.Formatters /// public class StringOutputFormatter : TextOutputFormatter { + /// + /// Initializes a new . + /// public StringOutputFormatter() { SupportedEncodings.Add(Encoding.UTF8); @@ -20,6 +23,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters SupportedMediaTypes.Add("text/plain"); } + /// public override bool CanWriteResult(OutputFormatterCanWriteContext context) { if (context == null) @@ -36,6 +40,7 @@ namespace Microsoft.AspNetCore.Mvc.Formatters return false; } + /// public override Task WriteResponseBodyAsync(OutputFormatterWriteContext context, Encoding encoding) { if (context == null) diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ActionContextAccessor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ActionContextAccessor.cs index 242721fb5b..df0d0810b9 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ActionContextAccessor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ActionContextAccessor.cs @@ -5,12 +5,16 @@ using System.Threading; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// Type that provides access to an . + /// public class ActionContextAccessor : IActionContextAccessor { internal static readonly IActionContextAccessor Null = new NullActionContextAccessor(); private static readonly AsyncLocal _storage = new AsyncLocal(); + /// public ActionContext ActionContext { get { return _storage.Value; } @@ -26,4 +30,4 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure } } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ContentResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ContentResultExecutor.cs index ba86f20db8..fd0d131c0d 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ContentResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ContentResultExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -8,12 +8,20 @@ using Microsoft.Extensions.Logging; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// A that is responsible for + /// public class ContentResultExecutor : IActionResultExecutor { private const string DefaultContentType = "text/plain; charset=utf-8"; private readonly ILogger _logger; private readonly IHttpResponseStreamWriterFactory _httpResponseStreamWriterFactory; + /// + /// Initializes a new instance of . + /// + /// The logger to use. + /// The stream writer factory. public ContentResultExecutor(ILogger logger, IHttpResponseStreamWriterFactory httpResponseStreamWriterFactory) { _logger = logger; diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/DefaultOutputFormatterSelector.cs b/src/Mvc/Mvc.Core/src/Infrastructure/DefaultOutputFormatterSelector.cs index d26d7decb4..8ad23344f3 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/DefaultOutputFormatterSelector.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/DefaultOutputFormatterSelector.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -14,6 +14,9 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// The default implementation of . + /// public class DefaultOutputFormatterSelector : OutputFormatterSelector { private static readonly Comparison _sortFunction = (left, right) => @@ -26,6 +29,11 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure private readonly bool _respectBrowserAcceptHeader; private readonly bool _returnHttpNotAcceptable; + /// + /// Initializes a new instance of + /// + /// Used to access . + /// The logger factory. public DefaultOutputFormatterSelector(IOptions options, ILoggerFactory loggerFactory) { if (options == null) @@ -45,6 +53,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure _returnHttpNotAcceptable = options.Value.ReturnHttpNotAcceptable; } + /// public override IOutputFormatter SelectFormatter(OutputFormatterCanWriteContext context, IList formatters, MediaTypeCollection contentTypes) { if (context == null) diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/FileContentResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/FileContentResultExecutor.cs index e4c2aef2c2..39c1673f67 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/FileContentResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/FileContentResultExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -9,8 +9,15 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// A + /// public class FileContentResultExecutor : FileResultExecutorBase, IActionResultExecutor { + /// + /// Intializes a new . + /// + /// The factory used to create loggers. public FileContentResultExecutor(ILoggerFactory loggerFactory) : base(CreateLogger(loggerFactory)) { @@ -47,6 +54,14 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure return WriteFileAsync(context, result, range, rangeLength); } + /// + /// Writes the file content. + /// + /// The action context. + /// The . + /// The . + /// The length of the range. + /// protected virtual Task WriteFileAsync(ActionContext context, FileContentResult result, RangeItemHeaderValue range, long rangeLength) { if (context == null) diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/FileResultExecutorBase.cs b/src/Mvc/Mvc.Core/src/Infrastructure/FileResultExecutorBase.cs index cc6acf5ad3..6078f212f0 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/FileResultExecutorBase.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/FileResultExecutorBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -15,12 +15,22 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// Base class for a file result. + /// public class FileResultExecutorBase { private const string AcceptRangeHeaderValue = "bytes"; + /// + /// The buffer size: 64 * 1024. + /// protected const int BufferSize = 64 * 1024; + /// + /// Intializes a new . + /// + /// The logger. public FileResultExecutorBase(ILogger logger) { Logger = logger; @@ -34,8 +44,21 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure PreconditionFailed } + /// + /// The logger to use. + /// protected ILogger Logger { get; } + /// + /// Sets etag and last modified headers. + /// + /// The . + /// The . + /// The nullable file length. + /// Whether range processing is enabled. + /// The nullable lastModified date. + /// The . + /// A tuple with the range, length, and whether the body was served. protected virtual (RangeItemHeaderValue range, long rangeLength, bool serveBody) SetHeadersAndLog( ActionContext context, FileResult result, @@ -348,6 +371,12 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure return length; } + /// + /// Creates a logger using the factory. + /// + /// The type being logged. + /// The . + /// An . protected static ILogger CreateLogger(ILoggerFactory factory) { if (factory == null) @@ -358,6 +387,14 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure return factory.CreateLogger(); } + /// + /// Write the contents of the fileStream to the response body. + /// + /// The . + /// The fileStream to write. + /// The . + /// The range length. + /// The async task. protected static async Task WriteFileAsync(HttpContext context, Stream fileStream, RangeItemHeaderValue range, long rangeLength) { var outputStream = context.Response.Body; diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/FileStreamResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/FileStreamResultExecutor.cs index df3a6feb28..c4eb7f151b 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/FileStreamResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/FileStreamResultExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -8,8 +8,15 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// An for a file stream result. + /// public class FileStreamResultExecutor : FileResultExecutorBase, IActionResultExecutor { + /// + /// Initializes a new . + /// + /// The factory used to create loggers. public FileStreamResultExecutor(ILoggerFactory loggerFactory) : base(CreateLogger(loggerFactory)) { @@ -55,6 +62,14 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure } } + /// + /// Write the contents of the FileStreamResult to the response body. + /// + /// The . + /// The FileStreamResult to write. + /// The . + /// The range length. + /// The async task. protected virtual Task WriteFileAsync( ActionContext context, FileStreamResult result, diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/IActionContextAccessor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/IActionContextAccessor.cs index f113257439..2789167504 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/IActionContextAccessor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/IActionContextAccessor.cs @@ -3,8 +3,14 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// Defines an interface for exposing an . + /// public interface IActionContextAccessor { + /// + /// Gets or sets the . + /// ActionContext ActionContext { get; set; } } } diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/LocalRedirectResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/LocalRedirectResultExecutor.cs index e44d5deb97..25b25cb6ca 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/LocalRedirectResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/LocalRedirectResultExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -11,11 +11,19 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// A that handles . + /// public class LocalRedirectResultExecutor : IActionResultExecutor { private readonly ILogger _logger; private readonly IUrlHelperFactory _urlHelperFactory; + /// + /// Initializes a new instance of . + /// + /// Used to create loggers. + /// Used to create url helpers. public LocalRedirectResultExecutor(ILoggerFactory loggerFactory, IUrlHelperFactory urlHelperFactory) { if (loggerFactory == null) diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/ModelStateInvalidFilter.cs b/src/Mvc/Mvc.Core/src/Infrastructure/ModelStateInvalidFilter.cs index 2cfc4ec773..31fb3abd8b 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/ModelStateInvalidFilter.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/ModelStateInvalidFilter.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -20,6 +20,11 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure private readonly ApiBehaviorOptions _apiBehaviorOptions; private readonly ILogger _logger; + /// + /// Initializes a new instance of . + /// + /// The api behavior options. + /// The logger. public ModelStateInvalidFilter(ApiBehaviorOptions apiBehaviorOptions, ILogger logger) { _apiBehaviorOptions = apiBehaviorOptions ?? throw new ArgumentNullException(nameof(apiBehaviorOptions)); @@ -54,10 +59,18 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure /// public bool IsReusable => true; + /// + /// Invoked when an action is executed. + /// + /// The . public void OnActionExecuted(ActionExecutedContext context) { } + /// + /// Invoked when an action is executing. + /// + /// The . public void OnActionExecuting(ActionExecutingContext context) { if (context.Result == null && !context.ModelState.IsValid) diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/PhysicalFileResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/PhysicalFileResultExecutor.cs index 8766196a3b..5fbf955ed6 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/PhysicalFileResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/PhysicalFileResultExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -13,8 +13,15 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// A for . + /// public class PhysicalFileResultExecutor : FileResultExecutorBase, IActionResultExecutor { + /// + /// Initializes a new instance of . + /// + /// The factory used to create loggers. public PhysicalFileResultExecutor(ILoggerFactory loggerFactory) : base(CreateLogger(loggerFactory)) { @@ -59,6 +66,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure return Task.CompletedTask; } + /// protected virtual Task WriteFileAsync(ActionContext context, PhysicalFileResult result, RangeItemHeaderValue range, long rangeLength) { if (context == null) @@ -99,6 +107,9 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure count: null); } + /// + /// Obsolete. This API is no longer called. + /// [Obsolete("This API is no longer called.")] protected virtual Stream GetFileStream(string path) { @@ -116,6 +127,11 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure FileOptions.Asynchronous | FileOptions.SequentialScan); } + /// + /// Get the file metadata for a path. + /// + /// The file path. + /// The for the path. protected virtual FileMetadata GetFileInfo(string path) { var fileInfo = new FileInfo(path); @@ -127,12 +143,24 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure }; } + /// + /// Represents metadata for a file. + /// protected class FileMetadata { + /// + /// Whether a file exists. + /// public bool Exists { get; set; } + /// + /// The file length. + /// public long Length { get; set; } + /// + /// When the file was last modified. + /// public DateTimeOffset LastModified { get; set; } } } diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/RedirectResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/RedirectResultExecutor.cs index 8a480cc237..943c61e925 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/RedirectResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/RedirectResultExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -10,11 +10,19 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// A for . + /// public class RedirectResultExecutor : IActionResultExecutor { private readonly ILogger _logger; private readonly IUrlHelperFactory _urlHelperFactory; + /// + /// Initializes a new instance of . + /// + /// The factory used to create loggers. + /// The factory used to create url helpers. public RedirectResultExecutor(ILoggerFactory loggerFactory, IUrlHelperFactory urlHelperFactory) { if (loggerFactory == null) diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/RedirectToActionResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/RedirectToActionResultExecutor.cs index 187968c1af..ba57f8c50c 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/RedirectToActionResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/RedirectToActionResultExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -11,11 +11,19 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// A for . + /// public class RedirectToActionResultExecutor : IActionResultExecutor { private readonly ILogger _logger; private readonly IUrlHelperFactory _urlHelperFactory; + /// + /// Initializes a new instance of . + /// + /// The factory used to create loggers. + /// The factory used to create url helpers. public RedirectToActionResultExecutor(ILoggerFactory loggerFactory, IUrlHelperFactory urlHelperFactory) { if (loggerFactory == null) @@ -75,4 +83,4 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure return Task.CompletedTask; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/RedirectToPageResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/RedirectToPageResultExecutor.cs index 3e87985983..8d6946849e 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/RedirectToPageResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/RedirectToPageResultExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -11,11 +11,19 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// A for . + /// public class RedirectToPageResultExecutor : IActionResultExecutor { private readonly ILogger _logger; private readonly IUrlHelperFactory _urlHelperFactory; + /// + /// Initializes a new instance of . + /// + /// The factory used to create loggers. + /// The factory used to create url helpers. public RedirectToPageResultExecutor(ILoggerFactory loggerFactory, IUrlHelperFactory urlHelperFactory) { if (loggerFactory == null) @@ -75,4 +83,4 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure return Task.CompletedTask; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/RedirectToRouteResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/RedirectToRouteResultExecutor.cs index 268ddd37cc..bca430b762 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/RedirectToRouteResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/RedirectToRouteResultExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -11,11 +11,19 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// A for . + /// public class RedirectToRouteResultExecutor : IActionResultExecutor { private readonly ILogger _logger; private readonly IUrlHelperFactory _urlHelperFactory; + /// + /// Initializes a new instance of . + /// + /// The factory used to create loggers. + /// The factory used to create url helpers. public RedirectToRouteResultExecutor(ILoggerFactory loggerFactory, IUrlHelperFactory urlHelperFactory) { if (loggerFactory == null) @@ -64,4 +72,4 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure return Task.CompletedTask; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/Infrastructure/VirtualFileResultExecutor.cs b/src/Mvc/Mvc.Core/src/Infrastructure/VirtualFileResultExecutor.cs index b25d9ac349..55c4f7163d 100644 --- a/src/Mvc/Mvc.Core/src/Infrastructure/VirtualFileResultExecutor.cs +++ b/src/Mvc/Mvc.Core/src/Infrastructure/VirtualFileResultExecutor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -15,10 +15,18 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.Infrastructure { + /// + /// A for . + /// public class VirtualFileResultExecutor : FileResultExecutorBase, IActionResultExecutor { private readonly IWebHostEnvironment _hostingEnvironment; + /// + /// Initializes a new instance of . + /// + /// The factory used to create loggers. + /// The hosting enviornment public VirtualFileResultExecutor(ILoggerFactory loggerFactory, IWebHostEnvironment hostingEnvironment) : base(CreateLogger(loggerFactory)) { @@ -69,6 +77,7 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure return Task.CompletedTask; } + /// protected virtual Task WriteFileAsync(ActionContext context, VirtualFileResult result, IFileInfo fileInfo, RangeItemHeaderValue range, long rangeLength) { if (context == null) @@ -134,6 +143,11 @@ namespace Microsoft.AspNetCore.Mvc.Infrastructure return result.FileProvider; } + /// + /// Obsolete, this API is no longer called. + /// + /// + /// [Obsolete("This API is no longer called.")] protected virtual Stream GetFileStream(IFileInfo fileInfo) { diff --git a/src/Mvc/Mvc.Core/src/JsonOptions.cs b/src/Mvc/Mvc.Core/src/JsonOptions.cs index dfce0ea4d5..0cdd4b055f 100644 --- a/src/Mvc/Mvc.Core/src/JsonOptions.cs +++ b/src/Mvc/Mvc.Core/src/JsonOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Text.Json; @@ -6,6 +6,9 @@ using Microsoft.AspNetCore.Mvc.Formatters; namespace Microsoft.AspNetCore.Mvc { + /// + /// Options to configure and . + /// public class JsonOptions { /// diff --git a/src/Mvc/Mvc.Core/src/Microsoft.AspNetCore.Mvc.Core.csproj b/src/Mvc/Mvc.Core/src/Microsoft.AspNetCore.Mvc.Core.csproj index 0a80a92a65..406f42f2c4 100644 --- a/src/Mvc/Mvc.Core/src/Microsoft.AspNetCore.Mvc.Core.csproj +++ b/src/Mvc/Mvc.Core/src/Microsoft.AspNetCore.Mvc.Core.csproj @@ -12,7 +12,7 @@ Microsoft.AspNetCore.Mvc.RequireHttpsAttribute Microsoft.AspNetCore.Mvc.RouteAttribute $(DefaultNetCoreTargetFramework) true - $(NoWarn);CS1591 + $(NoWarn.Replace('1591', '')) true aspnetcore;aspnetcoremvc false diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/ComplexObjectModelBinder.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/ComplexObjectModelBinder.cs index 392af54ea6..2fba89e16b 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/ComplexObjectModelBinder.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/ComplexObjectModelBinder.cs @@ -46,6 +46,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders _logger = logger; } + /// public Task BindModelAsync(ModelBindingContext bindingContext) { if (bindingContext == null) diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/ComplexTypeModelBinder.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/ComplexTypeModelBinder.cs index d9c1f0616b..7871503ec1 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/ComplexTypeModelBinder.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/ComplexTypeModelBinder.cs @@ -82,6 +82,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders _logger = loggerFactory.CreateLogger(); } + /// public Task BindModelAsync(ModelBindingContext bindingContext) { if (bindingContext == null) diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/DictionaryModelBinder.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/DictionaryModelBinder.cs index ad5e5207fe..60ca726ed5 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/DictionaryModelBinder.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/DictionaryModelBinder.cs @@ -252,6 +252,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders return base.CreateEmptyCollection(targetType); } + /// public override bool CanCreateInstance(Type targetType) { if (targetType.IsAssignableFrom(typeof(Dictionary))) diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/EnumTypeModelBinder.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/EnumTypeModelBinder.cs index c03d5912d3..fab254c8b1 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/EnumTypeModelBinder.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/EnumTypeModelBinder.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -40,6 +40,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders } } + /// protected override void CheckModel( ModelBindingContext bindingContext, ValueProviderResult valueProviderResult, diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/SimpleTypeModelBinder.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/SimpleTypeModelBinder.cs index 2bf1af977b..e77d2e8abb 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Binders/SimpleTypeModelBinder.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Binders/SimpleTypeModelBinder.cs @@ -115,6 +115,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Binders } } + /// protected virtual void CheckModel( ModelBindingContext bindingContext, ValueProviderResult valueProviderResult, diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/EmptyModelMetadataProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/EmptyModelMetadataProvider.cs index 22df255b21..af17aad7fe 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/EmptyModelMetadataProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/EmptyModelMetadataProvider.cs @@ -7,8 +7,14 @@ using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Mvc.ModelBinding { + /// + /// A that represents an empty model. + /// public class EmptyModelMetadataProvider : DefaultModelMetadataProvider { + /// + /// Initializes a new . + /// public EmptyModelMetadataProvider() : base( new DefaultCompositeMetadataDetailsProvider(new List()), @@ -21,4 +27,4 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding public MvcOptions Value { get; } = new MvcOptions(); } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/FormValueProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/FormValueProvider.cs index 278407db2d..2071ae107a 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/FormValueProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/FormValueProvider.cs @@ -42,8 +42,14 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding Culture = culture; } + /// + /// The culture to use. + /// public CultureInfo Culture { get; } + /// + /// The prefix container. + /// protected PrefixContainer PrefixContainer { get diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/IEnumerableValueProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/IEnumerableValueProvider.cs index 2e1a1cb82c..bf58a6153d 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/IEnumerableValueProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/IEnumerableValueProvider.cs @@ -5,8 +5,16 @@ using System.Collections.Generic; namespace Microsoft.AspNetCore.Mvc.ModelBinding { + /// + /// Interface representing an enumerable . + /// public interface IEnumerableValueProvider : IValueProvider { + /// + /// Gets the keys for a specific prefix. + /// + /// The prefix to enumerate. + /// The keys for the prefix. IDictionary GetKeysFromPrefix(string prefix); } } diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/BindingSourceMetadataProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/BindingSourceMetadataProvider.cs index 20c88b013f..7381784531 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/BindingSourceMetadataProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/BindingSourceMetadataProvider.cs @@ -1,10 +1,13 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata { + /// + /// Provides for a . + /// public class BindingSourceMetadataProvider : IBindingMetadataProvider { /// @@ -28,7 +31,16 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata BindingSource = bindingSource; } + + /// + /// The . The provider sets of the given or + /// anything assignable to the given . + /// public Type Type { get; } + + /// + /// The to assign to the Type. + /// public BindingSource BindingSource { get; } /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DefaultModelMetadata.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DefaultModelMetadata.cs index ef55b0e711..a403e38c88 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DefaultModelMetadata.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DefaultModelMetadata.cs @@ -407,6 +407,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata } } + /// public override IReadOnlyList BoundConstructorParameters => _details.BoundConstructorParameters; /// @@ -561,6 +562,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata /// public override Action PropertySetter => _details.PropertySetter; + /// public override Func BoundConstructorInvoker => _details.BoundConstructorInvoker; internal DefaultMetadataDetails Details => _details; diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DefaultModelMetadataProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DefaultModelMetadataProvider.cs index 1d7e3ed9bc..b11533725e 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DefaultModelMetadataProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Metadata/DefaultModelMetadataProvider.cs @@ -426,6 +426,13 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Metadata ModelAttributes.GetAttributesForType(key.ModelType)); } + /// + /// Creates the entry for a parameter . + /// + /// + /// The identifying the parameter . + /// + /// A details object for the parameter. protected virtual DefaultMetadataDetails CreateParameterDetails(ModelMetadataIdentity key) { return new DefaultMetadataDetails( diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/ModelNames.cs b/src/Mvc/Mvc.Core/src/ModelBinding/ModelNames.cs index 185c8345e0..999ce29d6c 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/ModelNames.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/ModelNames.cs @@ -6,18 +6,39 @@ using System.Globalization; namespace Microsoft.AspNetCore.Mvc.ModelBinding { + /// + /// Static class for helpers dealing with model names. + /// public static class ModelNames { + /// + /// Create an index model name from the parent name. + /// + /// The parent name. + /// The index. + /// The index model name. public static string CreateIndexModelName(string parentName, int index) { return CreateIndexModelName(parentName, index.ToString(CultureInfo.InvariantCulture)); } + /// + /// Create an index model name from the parent name. + /// + /// The parent name. + /// The index. + /// The index model name. public static string CreateIndexModelName(string parentName, string index) { return (parentName.Length == 0) ? "[" + index + "]" : parentName + "[" + index + "]"; } + /// + /// Create an property model name with a prefix. + /// + /// The prefix to use. + /// The property name. + /// The property model name. public static string CreatePropertyModelName(string prefix, string propertyName) { if (string.IsNullOrEmpty(prefix)) diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/PrefixContainer.cs b/src/Mvc/Mvc.Core/src/ModelBinding/PrefixContainer.cs index aa4b0a6f6b..ad3207615c 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/PrefixContainer.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/PrefixContainer.cs @@ -19,6 +19,10 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding private readonly ICollection _originalValues; private readonly string[] _sortedValues; + /// + /// Initializes a new instance of . + /// + /// The values for the container. public PrefixContainer(ICollection values) { if (values == null) @@ -40,6 +44,11 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding } } + /// + /// Checks if a prefix is in the container. + /// + /// The prefix to check. + /// True if the prefix is present. public bool ContainsPrefix(string prefix) { if (prefix == null) @@ -60,10 +69,17 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding return BinarySearch(prefix) > -1; } - // Given "foo.bar", "foo.hello", "something.other", foo[abc].baz and asking for prefix "foo" will return: - // - "bar"/"foo.bar" - // - "hello"/"foo.hello" - // - "abc"/"foo[abc]" + /// + /// Gets the keys from a prefix. + /// + /// + /// Given "foo.bar", "foo.hello", "something.other", foo[abc].baz and asking for prefix "foo" will return: + /// - "bar"/"foo.bar" + /// - "hello"/"foo.hello" + /// - "abc"/"foo[abc]" + /// + /// The prefix to enumerate. + /// The keys for the prefix. public IDictionary GetKeysFromPrefix(string prefix) { var result = new Dictionary(StringComparer.OrdinalIgnoreCase); diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/QueryStringValueProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/QueryStringValueProvider.cs index 9094a62dda..df06ff24d2 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/QueryStringValueProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/QueryStringValueProvider.cs @@ -42,8 +42,14 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding Culture = culture; } + /// + /// The culture for the provider. + /// public CultureInfo Culture { get; } + /// + /// The . + /// protected PrefixContainer PrefixContainer { get diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/RouteValueProvider.cs b/src/Mvc/Mvc.Core/src/ModelBinding/RouteValueProvider.cs index 66e1ea1c2e..efc98eddf1 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/RouteValueProvider.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/RouteValueProvider.cs @@ -56,6 +56,9 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding Culture = culture; } + /// + /// The prefix container. + /// protected PrefixContainer PrefixContainer { get @@ -69,6 +72,9 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding } } + /// + /// The culture to use. + /// protected CultureInfo Culture { get; } /// diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ClientValidatorCache.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ClientValidatorCache.cs index 41faf4d8a3..5df1a30852 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ClientValidatorCache.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ClientValidatorCache.cs @@ -9,10 +9,19 @@ using Microsoft.AspNetCore.Mvc.ModelBinding.Metadata; namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation { + /// + /// Cache for s. + /// public class ClientValidatorCache { private readonly ConcurrentDictionary _cacheEntries = new ConcurrentDictionary(); + /// + /// Gets the for the metadata from the cache, using the validatorProvider to create when needed. + /// + /// The being validated. + /// The which will be used to create validators when needed. + /// The list of s. public IReadOnlyList GetValidators(ModelMetadata metadata, IClientModelValidatorProvider validatorProvider) { if (metadata.MetadataKind == ModelMetadataKind.Property && diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidationVisitor.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidationVisitor.cs index 79108314f3..bfe60d9e35 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidationVisitor.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidationVisitor.cs @@ -59,18 +59,59 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation _currentPath = new ValidationStack(); } + /// + /// The model validator provider. + /// protected IModelValidatorProvider ValidatorProvider { get; } + + /// + /// The model metadata provider. + /// protected IModelMetadataProvider MetadataProvider { get; } + /// + /// The validator cache. + /// protected ValidatorCache Cache { get; } + + /// + /// The action context. + /// protected ActionContext Context { get; } + + /// + /// The model state. + /// protected ModelStateDictionary ModelState { get; } + + /// + /// The validation state. + /// protected ValidationStateDictionary ValidationState { get; } + /// + /// The container. + /// protected object Container { get; set; } + + /// + /// The key. + /// protected string Key { get; set; } + + /// + /// The model. + /// protected object Model { get; set; } + + /// + /// The model metadata. + /// protected ModelMetadata Metadata { get; set; } + + /// + /// The validation strategy. + /// protected IValidationStrategy Strategy { get; set; } /// @@ -234,6 +275,14 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation } } + /// + /// Validate something in a model. + /// + /// The model metadata. + /// The key to validate. + /// The model to validate. + /// if the specified model key is valid, otherwise . + /// Whether the the specified model key is valid. protected virtual bool Visit(ModelMetadata metadata, string key, object model) { RuntimeHelpers.EnsureSufficientExecutionStack(); @@ -338,7 +387,11 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation } } - // Covers everything VisitSimpleType does not i.e. both enumerations and complex types. + /// + /// Validate complex types, this covers everything VisitSimpleType does not i.e. both enumerations and complex types. + /// + /// The default validation strategy to use. + /// if valid, otherwise . protected virtual bool VisitComplexType(IValidationStrategy defaultStrategy) { var isValid = true; @@ -366,6 +419,10 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation return isValid; } + /// + /// Validate a simple type. + /// + /// True if valie. protected virtual bool VisitSimpleType() { if (ModelState.HasReachedMaxErrors) @@ -377,6 +434,11 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation return ValidateNode(); } + /// + /// Validate all the child nodes using the specified strategy. + /// + /// The validation strategy. + /// if all children are valid, otherwise . protected virtual bool VisitChildren(IValidationStrategy strategy) { var isValid = true; @@ -400,6 +462,10 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation return isValid; } + /// + /// Supress validation for a given key. + /// + /// The key to supress. protected virtual void SuppressValidation(string key) { if (key == null) @@ -419,6 +485,11 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation } } + /// + /// Get the validation entry for the model. + /// + /// The model. + /// The validation state entry for the model. protected virtual ValidationStateEntry GetValidationEntry(object model) { if (model == null || ValidationState == null) @@ -430,6 +501,9 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation return entry; } + /// + /// State manager used for by . + /// protected readonly struct StateManager : IDisposable { private readonly ValidationVisitor _visitor; @@ -439,6 +513,15 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation private readonly object _model; private readonly IValidationStrategy _strategy; + /// + /// Set up a state manager from a visitor. + /// + /// The visitor. + /// The key. + /// The metadata. + /// The model. + /// The strategy. + /// A StateManager setup for recursion. public static StateManager Recurse( ValidationVisitor visitor, string key, @@ -457,6 +540,11 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation return recursifier; } + /// + /// Initialize a new . + /// + /// The visitor. + /// The model to validate. public StateManager(ValidationVisitor visitor, object newModel) { _visitor = visitor; @@ -468,6 +556,7 @@ namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation _strategy = _visitor.Strategy; } + /// public void Dispose() { _visitor.Container = _container; diff --git a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidatorCache.cs b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidatorCache.cs index 5fadd38e29..9db100fa9f 100644 --- a/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidatorCache.cs +++ b/src/Mvc/Mvc.Core/src/ModelBinding/Validation/ValidatorCache.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -8,10 +8,19 @@ using System.Diagnostics; namespace Microsoft.AspNetCore.Mvc.ModelBinding.Validation { + /// + /// A cache for + /// public class ValidatorCache { private readonly ConcurrentDictionary _cacheEntries = new ConcurrentDictionary(); + /// + /// Get the validators for a model. + /// + /// The model metadata. + /// The validator provider. + /// A list of model validators. public IReadOnlyList GetValidators(ModelMetadata metadata, IModelValidatorProvider validatorProvider) { if (_cacheEntries.TryGetValue(metadata, out var entry)) diff --git a/src/Mvc/Mvc.Core/src/ObjectResult.cs b/src/Mvc/Mvc.Core/src/ObjectResult.cs index c85dfcc4ab..3ddfea84d3 100644 --- a/src/Mvc/Mvc.Core/src/ObjectResult.cs +++ b/src/Mvc/Mvc.Core/src/ObjectResult.cs @@ -9,10 +9,18 @@ using Microsoft.Extensions.DependencyInjection; namespace Microsoft.AspNetCore.Mvc { + /// + /// An that on execution will write an object to the response + /// using mechanisms provided by the host. + /// public class ObjectResult : ActionResult, IStatusCodeActionResult { private MediaTypeCollection _contentTypes; + /// + /// Creates a new instance with the provided . + /// + /// public ObjectResult(object value) { Value = value; @@ -20,17 +28,29 @@ namespace Microsoft.AspNetCore.Mvc _contentTypes = new MediaTypeCollection(); } + /// + /// The object result. + /// [ActionResultObjectValue] public object Value { get; set; } + /// + /// The collection of . + /// public FormatterCollection Formatters { get; set; } + /// + /// Gets or sets the . + /// public MediaTypeCollection ContentTypes { get => _contentTypes; set => _contentTypes = value ?? throw new ArgumentNullException(nameof(value)); } + /// + /// Gets or sets the declared type. + /// public Type DeclaredType { get; set; } /// @@ -38,6 +58,7 @@ namespace Microsoft.AspNetCore.Mvc /// public int? StatusCode { get; set; } + /// public override Task ExecuteResultAsync(ActionContext context) { var executor = context.HttpContext.RequestServices.GetRequiredService>(); @@ -72,4 +93,4 @@ namespace Microsoft.AspNetCore.Mvc } } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/Routing/IActionHttpMethodProvider.cs b/src/Mvc/Mvc.Core/src/Routing/IActionHttpMethodProvider.cs index 2c5d640ee8..981d3e9c8b 100644 --- a/src/Mvc/Mvc.Core/src/Routing/IActionHttpMethodProvider.cs +++ b/src/Mvc/Mvc.Core/src/Routing/IActionHttpMethodProvider.cs @@ -5,8 +5,14 @@ using System.Collections.Generic; namespace Microsoft.AspNetCore.Mvc.Routing { + /// + /// Interface that exposes a list of http methods that are supported by an provider. + /// public interface IActionHttpMethodProvider { + /// + /// The list of http methods this action provider supports. + /// IEnumerable HttpMethods { get; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Core/src/Routing/KnownRouteValueConstraint.cs b/src/Mvc/Mvc.Core/src/Routing/KnownRouteValueConstraint.cs index 3278ed286f..007d56a83d 100644 --- a/src/Mvc/Mvc.Core/src/Routing/KnownRouteValueConstraint.cs +++ b/src/Mvc/Mvc.Core/src/Routing/KnownRouteValueConstraint.cs @@ -13,11 +13,18 @@ using Microsoft.Extensions.DependencyInjection; namespace Microsoft.AspNetCore.Mvc.Routing { + /// + /// A that represents a known route value. + /// public class KnownRouteValueConstraint : IRouteConstraint { private readonly IActionDescriptorCollectionProvider _actionDescriptorCollectionProvider; private RouteValuesCollection _cachedValuesCollection; + /// + /// Initializes an instance of . + /// + /// The . public KnownRouteValueConstraint(IActionDescriptorCollectionProvider actionDescriptorCollectionProvider) { if (actionDescriptorCollectionProvider == null) @@ -28,6 +35,7 @@ namespace Microsoft.AspNetCore.Mvc.Routing _actionDescriptorCollectionProvider = actionDescriptorCollectionProvider; } + /// public bool Match( HttpContext httpContext, IRouter route, diff --git a/src/Mvc/Mvc.Core/src/Routing/UrlHelperBase.cs b/src/Mvc/Mvc.Core/src/Routing/UrlHelperBase.cs index 54eedb0e45..3b41153aa4 100644 --- a/src/Mvc/Mvc.Core/src/Routing/UrlHelperBase.cs +++ b/src/Mvc/Mvc.Core/src/Routing/UrlHelperBase.cs @@ -12,6 +12,9 @@ using Microsoft.AspNetCore.Routing; namespace Microsoft.AspNetCore.Mvc.Routing { + /// + /// An abstraction for . + /// public abstract class UrlHelperBase : IUrlHelper { // Perf: Share the StringBuilder object across multiple calls of GenerateURL for this UrlHelper @@ -20,6 +23,10 @@ namespace Microsoft.AspNetCore.Mvc.Routing // Perf: Reuse the RouteValueDictionary across multiple calls of Action for this UrlHelper private readonly RouteValueDictionary _routeValueDictionary; + /// + /// Initializes an instance of a + /// + /// The . protected UrlHelperBase(ActionContext actionContext) { if (actionContext == null) @@ -101,7 +108,6 @@ namespace Microsoft.AspNetCore.Mvc.Routing } } - /// public virtual string Content(string contentPath) { @@ -138,6 +144,11 @@ namespace Microsoft.AspNetCore.Mvc.Routing /// public abstract string RouteUrl(UrlRouteContext routeContext); + /// + /// Gets a using the specified values. + /// + /// The values to use. + /// A with the specified values. protected RouteValueDictionary GetValuesDictionary(object values) { // Perf: RouteValueDictionary can be cast to IDictionary, but it is @@ -167,6 +178,14 @@ namespace Microsoft.AspNetCore.Mvc.Routing return new RouteValueDictionary(values); } + /// + /// Generate a url using the specified values. + /// + /// The protocol. + /// The host. + /// The virtual path. + /// The fragment. + /// The generated url protected string GenerateUrl(string protocol, string host, string virtualPath, string fragment) { if (virtualPath == null) diff --git a/src/Mvc/Mvc.Core/src/UrlHelperExtensions.cs b/src/Mvc/Mvc.Core/src/UrlHelperExtensions.cs index 9c0f540f2f..ae893ae5d9 100644 --- a/src/Mvc/Mvc.Core/src/UrlHelperExtensions.cs +++ b/src/Mvc/Mvc.Core/src/UrlHelperExtensions.cs @@ -8,6 +8,9 @@ using Microsoft.AspNetCore.Routing; namespace Microsoft.AspNetCore.Mvc { + /// + /// Static class for url helper extension methods. + /// public static class UrlHelperExtensions { /// diff --git a/src/Mvc/Mvc.Cors/src/Microsoft.AspNetCore.Mvc.Cors.csproj b/src/Mvc/Mvc.Cors/src/Microsoft.AspNetCore.Mvc.Cors.csproj index 6409a547e4..0b35d11b10 100644 --- a/src/Mvc/Mvc.Cors/src/Microsoft.AspNetCore.Mvc.Cors.csproj +++ b/src/Mvc/Mvc.Cors/src/Microsoft.AspNetCore.Mvc.Cors.csproj @@ -1,4 +1,4 @@ - + ASP.NET Core MVC cross-origin resource sharing (CORS) features. @@ -7,6 +7,7 @@ true aspnetcore;aspnetcoremvc;cors false + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.DataAnnotations/src/Microsoft.AspNetCore.Mvc.DataAnnotations.csproj b/src/Mvc/Mvc.DataAnnotations/src/Microsoft.AspNetCore.Mvc.DataAnnotations.csproj index dcd837d20b..68b69b42af 100644 --- a/src/Mvc/Mvc.DataAnnotations/src/Microsoft.AspNetCore.Mvc.DataAnnotations.csproj +++ b/src/Mvc/Mvc.DataAnnotations/src/Microsoft.AspNetCore.Mvc.DataAnnotations.csproj @@ -1,4 +1,4 @@ - + ASP.NET Core MVC metadata and validation system using System.ComponentModel.DataAnnotations. @@ -7,6 +7,7 @@ true aspnetcore;aspnetcoremvc false + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.Formatters.Json/src/Microsoft.AspNetCore.Mvc.Formatters.Json.csproj b/src/Mvc/Mvc.Formatters.Json/src/Microsoft.AspNetCore.Mvc.Formatters.Json.csproj index 47b10f6ba8..da64e396a6 100644 --- a/src/Mvc/Mvc.Formatters.Json/src/Microsoft.AspNetCore.Mvc.Formatters.Json.csproj +++ b/src/Mvc/Mvc.Formatters.Json/src/Microsoft.AspNetCore.Mvc.Formatters.Json.csproj @@ -1,4 +1,4 @@ - + ASP.NET Core MVC formatters for JSON input and output. @@ -7,6 +7,7 @@ true aspnetcore;aspnetcoremvc;json false + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.Formatters.Xml/src/Microsoft.AspNetCore.Mvc.Formatters.Xml.csproj b/src/Mvc/Mvc.Formatters.Xml/src/Microsoft.AspNetCore.Mvc.Formatters.Xml.csproj index b42ee39139..19acdb8282 100644 --- a/src/Mvc/Mvc.Formatters.Xml/src/Microsoft.AspNetCore.Mvc.Formatters.Xml.csproj +++ b/src/Mvc/Mvc.Formatters.Xml/src/Microsoft.AspNetCore.Mvc.Formatters.Xml.csproj @@ -1,13 +1,14 @@ - + ASP.NET Core MVC formatters for XML input and output using DataContractSerializer and XmlSerializer. $(DefaultNetCoreTargetFramework) true - $(NoWarn);CS1591 + $(NoWarn.Replace('1591', '')) true aspnetcore;aspnetcoremvc;xml false + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.Formatters.Xml/src/SerializableErrorWrapper.cs b/src/Mvc/Mvc.Formatters.Xml/src/SerializableErrorWrapper.cs index 8a72825a80..f8f4a1108e 100644 --- a/src/Mvc/Mvc.Formatters.Xml/src/SerializableErrorWrapper.cs +++ b/src/Mvc/Mvc.Formatters.Xml/src/SerializableErrorWrapper.cs @@ -18,6 +18,9 @@ namespace Microsoft.AspNetCore.Mvc.Formatters.Xml // other ModelState entries because the character is not legal in an expression name. internal static readonly string EmptyKey = "MVC-Empty"; + /// + /// Initializes a new + /// // Note: XmlSerializer requires to have default constructor public SerializableErrorWrapper() { diff --git a/src/Mvc/Mvc.Localization/src/Microsoft.AspNetCore.Mvc.Localization.csproj b/src/Mvc/Mvc.Localization/src/Microsoft.AspNetCore.Mvc.Localization.csproj index e3f4cfd3c8..863e62cd20 100644 --- a/src/Mvc/Mvc.Localization/src/Microsoft.AspNetCore.Mvc.Localization.csproj +++ b/src/Mvc/Mvc.Localization/src/Microsoft.AspNetCore.Mvc.Localization.csproj @@ -1,4 +1,4 @@ - + ASP.NET Core MVC features that enable globalization and localization of applications. @@ -10,6 +10,7 @@ Microsoft.AspNetCore.Mvc.Localization.IViewLocalizer true aspnetcore;aspnetcoremvc;localization false + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.NewtonsoftJson/src/Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj b/src/Mvc/Mvc.NewtonsoftJson/src/Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj index b6374dbe75..4d3c92d25b 100644 --- a/src/Mvc/Mvc.NewtonsoftJson/src/Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj +++ b/src/Mvc/Mvc.NewtonsoftJson/src/Microsoft.AspNetCore.Mvc.NewtonsoftJson.csproj @@ -1,4 +1,4 @@ - + ASP.NET Core MVC features that use Newtonsoft.Json. Includes input and output formatters for JSON and JSON PATCH. @@ -7,6 +7,7 @@ aspnetcore;aspnetcoremvc;json true $(DefineConstants);JSONNET + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/AssemblyPartExtensions.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/AssemblyPartExtensions.cs index e3ceaa8817..4f3c3ef44f 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/AssemblyPartExtensions.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/AssemblyPartExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -8,6 +8,9 @@ using Microsoft.Extensions.DependencyModel; namespace Microsoft.AspNetCore.Mvc.ApplicationParts { + /// + /// Static class that adds methods to . + /// public static class AssemblyPartExtensions { /// diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcBuilderExtensions.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcBuilderExtensions.cs index a673954e3d..78104364da 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcBuilderExtensions.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcBuilderExtensions.cs @@ -6,6 +6,9 @@ using Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation; namespace Microsoft.Extensions.DependencyInjection { + /// + /// Static class that adds razor compilation extenstion methods. + /// public static class RazorRuntimeCompilationMvcBuilderExtensions { /// diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcCoreBuilderExtensions.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcCoreBuilderExtensions.cs index f7e1d9142a..4411eaf53a 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcCoreBuilderExtensions.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/DependencyInjection/RazorRuntimeCompilationMvcCoreBuilderExtensions.cs @@ -15,6 +15,9 @@ using Microsoft.Extensions.Options; namespace Microsoft.Extensions.DependencyInjection { + /// + /// Static class that adds razor runtime compilation extension methods. + /// public static class RazorRuntimeCompilationMvcCoreBuilderExtensions { /// diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectItem.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectItem.cs index 58cbf71ddf..d0abfbcbda 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectItem.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/FileProviderRazorProjectItem.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -8,16 +8,34 @@ using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation { + /// + /// A file provider . + /// public class FileProviderRazorProjectItem : RazorProjectItem { private string _root; private string _relativePhysicalPath; private bool _isRelativePhysicalPathSet; + /// + /// Intializes a new instance of a . + /// + /// The file info. + /// The base path. + /// The file path. + /// The root. public FileProviderRazorProjectItem(IFileInfo fileInfo, string basePath, string filePath, string root) : this(fileInfo, basePath, filePath, root, fileKind: null) { } + /// + /// Intializes a new instance of a . + /// + /// The file info. + /// The base path. + /// The file path. + /// The root. + /// The kind of file. public FileProviderRazorProjectItem(IFileInfo fileInfo, string basePath, string filePath, string root, string fileKind) { FileInfo = fileInfo; @@ -27,18 +45,27 @@ namespace Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation _root = root; } + /// + /// The . + /// public IFileInfo FileInfo { get; } + /// public override string BasePath { get; } + /// public override string FilePath { get; } + /// public override string FileKind { get; } + /// public override bool Exists => FileInfo.Exists; + /// public override string PhysicalPath => FileInfo.PhysicalPath; + /// public override string RelativePhysicalPath { get @@ -64,9 +91,10 @@ namespace Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation } } + /// public override Stream Read() { return FileInfo.CreateReadStream(); } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj index 565757c491..4185aed7e5 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.csproj @@ -1,4 +1,4 @@ - + Runtime compilation support for Razor views and Razor Pages in ASP.NET Core MVC. $(DefaultNetCoreTargetFramework) @@ -7,6 +7,7 @@ true aspnetcore;aspnetcoremvc;razor true + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/MvcRazorRuntimeCompilationOptions.cs b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/MvcRazorRuntimeCompilationOptions.cs index 237d9554ca..64c502e1b1 100644 --- a/src/Mvc/Mvc.Razor.RuntimeCompilation/src/MvcRazorRuntimeCompilationOptions.cs +++ b/src/Mvc/Mvc.Razor.RuntimeCompilation/src/MvcRazorRuntimeCompilationOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; @@ -8,6 +8,9 @@ using Microsoft.Extensions.FileProviders; namespace Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation { + /// + /// Used to configure razor compilation. + /// public class MvcRazorRuntimeCompilationOptions { /// diff --git a/src/Mvc/Mvc.Razor/src/Compilation/IViewCompiler.cs b/src/Mvc/Mvc.Razor/src/Compilation/IViewCompiler.cs index f861fa8c58..1685bc3604 100644 --- a/src/Mvc/Mvc.Razor/src/Compilation/IViewCompiler.cs +++ b/src/Mvc/Mvc.Razor/src/Compilation/IViewCompiler.cs @@ -1,12 +1,20 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Threading.Tasks; namespace Microsoft.AspNetCore.Mvc.Razor.Compilation { + /// + /// Represents a view compiler. + /// public interface IViewCompiler { + /// + /// Compile a view at the specified path. + /// + /// The relative path to the view. + /// A . Task CompileAsync(string relativePath); } } diff --git a/src/Mvc/Mvc.Razor/src/Compilation/IViewCompilerProvider.cs b/src/Mvc/Mvc.Razor/src/Compilation/IViewCompilerProvider.cs index 34c65481f6..f762f50c2e 100644 --- a/src/Mvc/Mvc.Razor/src/Compilation/IViewCompilerProvider.cs +++ b/src/Mvc/Mvc.Razor/src/Compilation/IViewCompilerProvider.cs @@ -1,10 +1,17 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace Microsoft.AspNetCore.Mvc.Razor.Compilation { + /// + /// Provides a . + /// public interface IViewCompilerProvider { + /// + /// Gets a . + /// + /// The view compiler. IViewCompiler GetCompiler(); } } diff --git a/src/Mvc/Mvc.Razor/src/Compilation/RazorViewAttribute.cs b/src/Mvc/Mvc.Razor/src/Compilation/RazorViewAttribute.cs index 233edc6aa1..1d552a4ff1 100644 --- a/src/Mvc/Mvc.Razor/src/Compilation/RazorViewAttribute.cs +++ b/src/Mvc/Mvc.Razor/src/Compilation/RazorViewAttribute.cs @@ -1,14 +1,22 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; namespace Microsoft.AspNetCore.Mvc.Razor.Compilation { + /// + /// This class is replaced by RazorCompiledItem and will not be used by the runtime. + /// [Obsolete("This attribute has been superseded by RazorCompiledItem and will not be used by the runtime.")] [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] public class RazorViewAttribute : Attribute { + /// + /// This class is replaced by RazorCompiledItem and will not be used by the runtime. + /// + /// The path. + /// The viewtype. public RazorViewAttribute(string path, Type viewType) { Path = path; diff --git a/src/Mvc/Mvc.Razor/src/Compilation/ViewsFeature.cs b/src/Mvc/Mvc.Razor/src/Compilation/ViewsFeature.cs index dde65a6340..4d037eeba4 100644 --- a/src/Mvc/Mvc.Razor/src/Compilation/ViewsFeature.cs +++ b/src/Mvc/Mvc.Razor/src/Compilation/ViewsFeature.cs @@ -1,12 +1,18 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; namespace Microsoft.AspNetCore.Mvc.Razor.Compilation { + /// + /// A feature that contains view descriptors. + /// public class ViewsFeature { + /// + /// A list of . + /// public IList ViewDescriptors { get; } = new List(); } } diff --git a/src/Mvc/Mvc.Razor/src/DependencyInjection/MvcRazorMvcCoreBuilderExtensions.cs b/src/Mvc/Mvc.Razor/src/DependencyInjection/MvcRazorMvcCoreBuilderExtensions.cs index fc94c6d209..cf6deb06a1 100644 --- a/src/Mvc/Mvc.Razor/src/DependencyInjection/MvcRazorMvcCoreBuilderExtensions.cs +++ b/src/Mvc/Mvc.Razor/src/DependencyInjection/MvcRazorMvcCoreBuilderExtensions.cs @@ -18,8 +18,16 @@ using Microsoft.Extensions.Options; namespace Microsoft.Extensions.DependencyInjection { + /// + /// Static class that adds RazorViewEngine methods to . + /// public static class MvcRazorMvcCoreBuilderExtensions { + /// + /// Registers Razor view engine services. + /// + /// The . + /// The . public static IMvcCoreBuilder AddRazorViewEngine(this IMvcCoreBuilder builder) { if (builder == null) @@ -33,6 +41,12 @@ namespace Microsoft.Extensions.DependencyInjection return builder; } + /// + /// Registers Razor view engine services. + /// + /// The . + /// A setup action that configures the . + /// The . public static IMvcCoreBuilder AddRazorViewEngine( this IMvcCoreBuilder builder, Action setupAction) diff --git a/src/Mvc/Mvc.Razor/src/Diagnostics/MvcDiagnostics.cs b/src/Mvc/Mvc.Razor/src/Diagnostics/MvcDiagnostics.cs index 45680406f1..14e91364da 100644 --- a/src/Mvc/Mvc.Razor/src/Diagnostics/MvcDiagnostics.cs +++ b/src/Mvc/Mvc.Razor/src/Diagnostics/MvcDiagnostics.cs @@ -10,12 +10,25 @@ using Microsoft.AspNetCore.Mvc.Rendering; namespace Microsoft.AspNetCore.Mvc.Diagnostics { + /// + /// An that occurs before a view page. + /// public sealed class BeforeViewPageEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "Razor." + "BeforeViewPage"; + /// + /// Initializes a new instance of . + /// + /// The page. + /// The view context. + /// The action. + /// The http context. public BeforeViewPageEventData(IRazorPage page, ViewContext viewContext, ActionDescriptor actionDescriptor, HttpContext httpContext) { Page = page; @@ -24,13 +37,30 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics HttpContext = httpContext; } + /// + /// The . + /// public IRazorPage Page { get; } + + /// + /// The . + /// public ViewContext ViewContext { get; } + + /// + /// The . + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The . + /// public HttpContext HttpContext { get; } + /// protected override int Count => 4; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(Page), Page), @@ -41,12 +71,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after a view page. + /// public sealed class AfterViewPageEventData : EventData { + /// + /// The name of the event. + /// public const string EventName = EventNamespace + "Razor." + "AfterViewPage"; + /// + /// Initializes a new instance of . + /// + /// The page. + /// The view context. + /// The action. + /// The http context. public AfterViewPageEventData(IRazorPage page, ViewContext viewContext, ActionDescriptor actionDescriptor, HttpContext httpContext) { Page = page; @@ -55,13 +98,30 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics HttpContext = httpContext; } + /// + /// The . + /// public IRazorPage Page { get; } + + /// + /// The . + /// public ViewContext ViewContext { get; } + + /// + /// The . + /// public ActionDescriptor ActionDescriptor { get; } + + /// + /// The . + /// public HttpContext HttpContext { get; } + /// protected override int Count => 4; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(Page), Page), @@ -71,4 +131,4 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics _ => throw new IndexOutOfRangeException(nameof(index)) }; } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Razor/src/Microsoft.AspNetCore.Mvc.Razor.csproj b/src/Mvc/Mvc.Razor/src/Microsoft.AspNetCore.Mvc.Razor.csproj index e9fc306a9e..dcc5aa2905 100644 --- a/src/Mvc/Mvc.Razor/src/Microsoft.AspNetCore.Mvc.Razor.csproj +++ b/src/Mvc/Mvc.Razor/src/Microsoft.AspNetCore.Mvc.Razor.csproj @@ -1,4 +1,4 @@ - + ASP.NET Core MVC Razor view engine for CSHTML files. @@ -8,6 +8,7 @@ true aspnetcore;aspnetcoremvc;cshtml;razor false + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.Razor/src/RazorPage.cs b/src/Mvc/Mvc.Razor/src/RazorPage.cs index be763a3d70..e11113d6ba 100644 --- a/src/Mvc/Mvc.Razor/src/RazorPage.cs +++ b/src/Mvc/Mvc.Razor/src/RazorPage.cs @@ -274,11 +274,13 @@ namespace Microsoft.AspNetCore.Mvc.Razor } } + /// public override void BeginContext(int position, int length, bool isLiteral) { // noop } + /// public override void EndContext() { // noop @@ -292,4 +294,4 @@ namespace Microsoft.AspNetCore.Mvc.Razor } } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Razor/src/RazorPageBase.cs b/src/Mvc/Mvc.Razor/src/RazorPageBase.cs index c8af0141b9..034ba67806 100644 --- a/src/Mvc/Mvc.Razor/src/RazorPageBase.cs +++ b/src/Mvc/Mvc.Razor/src/RazorPageBase.cs @@ -37,8 +37,10 @@ namespace Microsoft.AspNetCore.Mvc.Razor private TagHelperAttributeInfo _tagHelperAttributeInfo; private IUrlHelper _urlHelper; + /// public virtual ViewContext ViewContext { get; set; } + /// public string Layout { get; set; } /// @@ -136,6 +138,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor } } + /// public abstract Task ExecuteAsync(); /// @@ -278,6 +281,10 @@ namespace Microsoft.AspNetCore.Mvc.Razor return content; } + /// + /// Puts a text writer on the stack. + /// + /// // Internal for unit testing. protected internal virtual void PushWriter(TextWriter writer) { @@ -291,6 +298,10 @@ namespace Microsoft.AspNetCore.Mvc.Razor viewContext.Writer = writer; } + /// + /// Return a text writer from the stack. + /// + /// The text writer. // Internal for unit testing. protected internal virtual TextWriter PopWriter() { @@ -300,6 +311,11 @@ namespace Microsoft.AspNetCore.Mvc.Razor return writer; } + /// + /// Returns a href for the given content path. + /// + /// The content path. + /// The href for the contentPath. public virtual string Href(string contentPath) { if (contentPath == null) @@ -438,6 +454,15 @@ namespace Microsoft.AspNetCore.Mvc.Razor } } + /// + /// Begins writing out an attribute. + /// + /// The name. + /// The prefix. + /// The prefix offset. + /// The suffix. + /// The suffix offset. + /// The attribute values count. public virtual void BeginWriteAttribute( string name, string prefix, @@ -466,6 +491,15 @@ namespace Microsoft.AspNetCore.Mvc.Razor } } + /// + /// Writes out an attribute value. + /// + /// The prefix. + /// The prefix offset. + /// The value. + /// The value offset. + /// The value length. + /// Whether the attribute is a literal. public void WriteAttributeValue( string prefix, int prefixOffset, @@ -511,6 +545,9 @@ namespace Microsoft.AspNetCore.Mvc.Razor } } + /// + /// Ends writing an attribute. + /// public virtual void EndWriteAttribute() { if (!_attributeInfo.Suppressed) @@ -519,6 +556,13 @@ namespace Microsoft.AspNetCore.Mvc.Razor } } + /// + /// Begins adding html attribute values. + /// + /// The . + /// The name of the attribute. + /// The number of attribute values. + /// The . public void BeginAddHtmlAttributeValues( TagHelperExecutionContext executionContext, string attributeName, @@ -532,6 +576,15 @@ namespace Microsoft.AspNetCore.Mvc.Razor attributeValueStyle); } + /// + /// Add an html attribute value. + /// + /// The prefix. + /// The prefix offset. + /// The attribute value. + /// The value offset. + /// The value length. + /// Whether the attribute is a literal. public void AddHtmlAttributeValue( string prefix, int prefixOffset, @@ -587,6 +640,10 @@ namespace Microsoft.AspNetCore.Mvc.Razor } } + /// + /// Ends adding html attribute values. + /// + /// The . public void EndAddHtmlAttributeValues(TagHelperExecutionContext executionContext) { if (!_tagHelperAttributeInfo.Suppressed) @@ -681,8 +738,10 @@ namespace Microsoft.AspNetCore.Mvc.Razor EndContext(); } + /// public abstract void BeginContext(int position, int length, bool isLiteral); + /// public abstract void EndContext(); private bool IsBoolFalseOrNullValue(string prefix, object value) @@ -699,6 +758,7 @@ namespace Microsoft.AspNetCore.Mvc.Razor (value is bool && (bool)value); } + /// public abstract void EnsureRenderedBodyOrSections(); private struct AttributeInfo @@ -779,4 +839,4 @@ namespace Microsoft.AspNetCore.Mvc.Razor public TextWriter Writer { get; } } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Razor/src/RazorViewEngine.cs b/src/Mvc/Mvc.Razor/src/RazorViewEngine.cs index 7c3881b37e..bfa366575c 100644 --- a/src/Mvc/Mvc.Razor/src/RazorViewEngine.cs +++ b/src/Mvc/Mvc.Razor/src/RazorViewEngine.cs @@ -27,6 +27,9 @@ namespace Microsoft.AspNetCore.Mvc.Razor /// public class RazorViewEngine : IRazorViewEngine { + /// + /// The view extension + /// public static readonly string ViewExtension = ".cshtml"; private const string AreaKey = "area"; diff --git a/src/Mvc/Mvc.Razor/src/RenderAsyncDelegate.cs b/src/Mvc/Mvc.Razor/src/RenderAsyncDelegate.cs index ecdce26f06..c1dd3bb745 100644 --- a/src/Mvc/Mvc.Razor/src/RenderAsyncDelegate.cs +++ b/src/Mvc/Mvc.Razor/src/RenderAsyncDelegate.cs @@ -5,5 +5,9 @@ using System.Threading.Tasks; namespace Microsoft.AspNetCore.Mvc.Razor { + /// + /// A delegate for RenderAsync. + /// + /// public delegate Task RenderAsyncDelegate(); -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.Razor/src/TagHelpers/TagHelperComponentTagHelper.cs b/src/Mvc/Mvc.Razor/src/TagHelpers/TagHelperComponentTagHelper.cs index 14f11998c9..e3df1d85a7 100644 --- a/src/Mvc/Mvc.Razor/src/TagHelpers/TagHelperComponentTagHelper.cs +++ b/src/Mvc/Mvc.Razor/src/TagHelpers/TagHelperComponentTagHelper.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -56,6 +56,9 @@ namespace Microsoft.AspNetCore.Mvc.Razor.TagHelpers [HtmlAttributeNotBound] public ITagHelperComponentPropertyActivator PropertyActivator { get; set; } + /// + /// The . + /// [ViewContext] [HtmlAttributeNotBound] public ViewContext ViewContext { get; set; } diff --git a/src/Mvc/Mvc.Razor/src/TagHelpers/TagHelperFeatureProvider.cs b/src/Mvc/Mvc.Razor/src/TagHelpers/TagHelperFeatureProvider.cs index 1b24fb7480..2f15d6a8b2 100644 --- a/src/Mvc/Mvc.Razor/src/TagHelpers/TagHelperFeatureProvider.cs +++ b/src/Mvc/Mvc.Razor/src/TagHelpers/TagHelperFeatureProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; @@ -8,8 +8,12 @@ using Microsoft.AspNetCore.Razor.TagHelpers; namespace Microsoft.AspNetCore.Mvc.Razor.TagHelpers { + /// + /// An for the . + /// public class TagHelperFeatureProvider : IApplicationFeatureProvider { + /// public void PopulateFeature(IEnumerable parts, TagHelperFeature feature) { foreach (var part in parts) @@ -28,8 +32,18 @@ namespace Microsoft.AspNetCore.Mvc.Razor.TagHelpers } } + /// + /// Include a part. + /// + /// The part to include. + /// True if included. protected virtual bool IncludePart(ApplicationPart part) => true; + /// + /// Include a type. + /// + /// The type to include. + /// True if included. protected virtual bool IncludeType(TypeInfo type) { // We don't need to check visibility here, that's handled by the type provider. diff --git a/src/Mvc/Mvc.Razor/src/TagHelpers/UrlResolutionTagHelper.cs b/src/Mvc/Mvc.Razor/src/TagHelpers/UrlResolutionTagHelper.cs index 24051f9ebd..764835a645 100644 --- a/src/Mvc/Mvc.Razor/src/TagHelpers/UrlResolutionTagHelper.cs +++ b/src/Mvc/Mvc.Razor/src/TagHelpers/UrlResolutionTagHelper.cs @@ -97,10 +97,19 @@ namespace Microsoft.AspNetCore.Mvc.Razor.TagHelpers /// public override int Order => -1000 - 999; + /// + /// The . + /// protected IUrlHelperFactory UrlHelperFactory { get; } + /// + /// The . + /// protected HtmlEncoder HtmlEncoder { get; } + /// + /// The . + /// [HtmlAttributeNotBound] [ViewContext] public ViewContext ViewContext { get; set; } diff --git a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageApplicationModelProviderContext.cs b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageApplicationModelProviderContext.cs index cccb6824e5..0857512d12 100644 --- a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageApplicationModelProviderContext.cs +++ b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageApplicationModelProviderContext.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Reflection; @@ -11,6 +11,11 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels /// public class PageApplicationModelProviderContext { + /// + /// Instantiates a new instance of . + /// + /// The . + /// The type of the page. public PageApplicationModelProviderContext(PageActionDescriptor descriptor, TypeInfo pageTypeInfo) { ActionDescriptor = descriptor; @@ -32,4 +37,4 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels /// public PageApplicationModel PageApplicationModel { get; set; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageConventionCollection.cs b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageConventionCollection.cs index 5f738762d9..2a08355c95 100644 --- a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageConventionCollection.cs +++ b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageConventionCollection.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -10,6 +10,9 @@ using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Mvc.ApplicationModels { + /// + /// Collection of . + /// public class PageConventionCollection : Collection { private readonly IServiceProvider _serviceProvider; diff --git a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageParameterModel.cs b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageParameterModel.cs index 0b4851b1ee..2782032cc8 100644 --- a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageParameterModel.cs +++ b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageParameterModel.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -8,9 +8,17 @@ using System.Reflection; namespace Microsoft.AspNetCore.Mvc.ApplicationModels { + /// + /// A model type for reading and manipulation properties and parameters representing a Page Parameter. + /// [DebuggerDisplay("PageParameterModel: Name={ParameterName}")] public class PageParameterModel : ParameterModelBase, ICommonModel, IBindingModel { + /// + /// Initializes a new instance of a . + /// + /// The parameter info. + /// The attributes. public PageParameterModel( ParameterInfo parameterInfo, IReadOnlyList attributes) @@ -29,6 +37,10 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels ParameterInfo = parameterInfo; } + /// + /// Copy constructor. + /// + /// The model to copy. public PageParameterModel(PageParameterModel other) : base(other) { @@ -41,16 +53,25 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels ParameterInfo = other.ParameterInfo; } + /// + /// The . + /// public PageHandlerModel Handler { get; set; } MemberInfo ICommonModel.MemberInfo => ParameterInfo.Member; + /// + /// The . + /// public ParameterInfo ParameterInfo { get; } + /// + /// Gets or sets the parameter name. + /// public string ParameterName { get => Name; set => Name = value; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PagePropertyModel.cs b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PagePropertyModel.cs index 5af225dee6..7c053c9e5e 100644 --- a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PagePropertyModel.cs +++ b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PagePropertyModel.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -52,12 +52,18 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels MemberInfo ICommonModel.MemberInfo => PropertyInfo; + /// + /// The . + /// public PropertyInfo PropertyInfo { get; } + /// + /// Gets or sets the property name. + /// public string PropertyName { get => Name; set => Name = value; } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageRouteTransformerConvention.cs b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageRouteTransformerConvention.cs index 14903649a9..2bec753887 100644 --- a/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageRouteTransformerConvention.cs +++ b/src/Mvc/Mvc.RazorPages/src/ApplicationModels/PageRouteTransformerConvention.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -29,6 +29,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels _parameterTransformer = parameterTransformer; } + /// public void Apply(PageRouteModel model) { if (ShouldApply(model)) @@ -37,6 +38,11 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels } } + /// + /// Called to determine if this convention should apply. + /// + /// The action in question. + /// Whether this convention should apply. protected virtual bool ShouldApply(PageRouteModel action) => true; } } diff --git a/src/Mvc/Mvc.RazorPages/src/DependencyInjection/MvcRazorPagesMvcCoreBuilderExtensions.cs b/src/Mvc/Mvc.RazorPages/src/DependencyInjection/MvcRazorPagesMvcCoreBuilderExtensions.cs index 81e7fbbb30..df9d4ae3ae 100644 --- a/src/Mvc/Mvc.RazorPages/src/DependencyInjection/MvcRazorPagesMvcCoreBuilderExtensions.cs +++ b/src/Mvc/Mvc.RazorPages/src/DependencyInjection/MvcRazorPagesMvcCoreBuilderExtensions.cs @@ -15,8 +15,16 @@ using Resources = Microsoft.AspNetCore.Mvc.RazorPages.Resources; namespace Microsoft.Extensions.DependencyInjection { + /// + /// Static class that adds razor page functionality to . + /// public static class MvcRazorPagesMvcCoreBuilderExtensions { + /// + /// Register services needed for Razor Pages. + /// + /// The . + /// The . public static IMvcCoreBuilder AddRazorPages(this IMvcCoreBuilder builder) { if (builder == null) @@ -31,6 +39,12 @@ namespace Microsoft.Extensions.DependencyInjection return builder; } + /// + /// Register services needed for Razor Pages. + /// + /// The . + /// The action to setup the . + /// The . public static IMvcCoreBuilder AddRazorPages( this IMvcCoreBuilder builder, Action setupAction) diff --git a/src/Mvc/Mvc.RazorPages/src/Diagnostics/MvcDiagnostics.cs b/src/Mvc/Mvc.RazorPages/src/Diagnostics/MvcDiagnostics.cs index 5706b255d8..3a71aa56dc 100644 --- a/src/Mvc/Mvc.RazorPages/src/Diagnostics/MvcDiagnostics.cs +++ b/src/Mvc/Mvc.RazorPages/src/Diagnostics/MvcDiagnostics.cs @@ -9,10 +9,23 @@ using Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure; namespace Microsoft.AspNetCore.Mvc.Diagnostics { + /// + /// An that occurs before a handler method is called. + /// public sealed class BeforeHandlerMethodEventData : EventData { + /// + /// Name of the event. + /// public const string EventName = EventNamespace + "BeforeHandlerMethod"; + /// + /// Initializes a new instance of . + /// + /// The action context. + /// The arguments to the method. + /// The method descriptor. + /// The instance. public BeforeHandlerMethodEventData(ActionContext actionContext, IReadOnlyDictionary arguments, HandlerMethodDescriptor handlerMethodDescriptor, object instance) { ActionContext = actionContext; @@ -21,13 +34,30 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Instance = instance; } + /// + /// The . + /// public ActionContext ActionContext { get; } + + /// + /// The arguments to the method. + /// public IReadOnlyDictionary Arguments { get; } + + /// + /// The . + /// public HandlerMethodDescriptor HandlerMethodDescriptor { get; } + + /// + /// The instance. + /// public object Instance { get; } + /// protected override int Count => 4; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionContext), ActionContext), @@ -38,10 +68,24 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after a handler method is called. + /// public sealed class AfterHandlerMethodEventData : EventData { + /// + /// Name of the event. + /// public const string EventName = EventNamespace + "AfterHandlerMethod"; + /// + /// Initializes a new instance of . + /// + /// The action context. + /// The arguments to the method. + /// The method descriptor. + /// The instance. + /// The result of the handler method public AfterHandlerMethodEventData(ActionContext actionContext, IReadOnlyDictionary arguments, HandlerMethodDescriptor handlerMethodDescriptor, object instance, IActionResult result) { ActionContext = actionContext; @@ -51,14 +95,35 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Result = result; } + /// + /// The . + /// public ActionContext ActionContext { get; } + + /// + /// The arguments to the method. + /// public IReadOnlyDictionary Arguments { get; } + + /// + /// The . + /// public HandlerMethodDescriptor HandlerMethodDescriptor { get; } + + /// + /// The instance. + /// public object Instance { get; } + + /// + /// The result of the method. + /// public IActionResult Result { get; } + /// protected override int Count => 5; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionContext), ActionContext), @@ -70,10 +135,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before page handler execution. + /// public sealed class BeforePageFilterOnPageHandlerExecutionEventData : EventData { + /// + /// Name of the event. + /// public const string EventName = EventNamespace + "BeforeOnPageHandlerExecution"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforePageFilterOnPageHandlerExecutionEventData(CompiledPageActionDescriptor actionDescriptor, PageHandlerExecutingContext handlerExecutionContext, IAsyncPageFilter filter) { ActionDescriptor = actionDescriptor; @@ -81,12 +158,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The . + /// public CompiledPageActionDescriptor ActionDescriptor { get; } + + /// + /// The . + /// public PageHandlerExecutingContext HandlerExecutionContext { get; } + + /// + /// The . + /// public IAsyncPageFilter Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -96,10 +186,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after page handler execution. + /// public sealed class AfterPageFilterOnPageHandlerExecutionEventData : EventData { + /// + /// Name of the event. + /// public const string EventName = EventNamespace + "AfterOnPageHandlerExecution"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterPageFilterOnPageHandlerExecutionEventData(CompiledPageActionDescriptor actionDescriptor, PageHandlerExecutedContext handlerExecutedContext, IAsyncPageFilter filter) { ActionDescriptor = actionDescriptor; @@ -107,12 +209,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The . + /// public CompiledPageActionDescriptor ActionDescriptor { get; } + + /// + /// The . + /// public PageHandlerExecutedContext HandlerExecutedContext { get; } + + /// + /// The . + /// public IAsyncPageFilter Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -122,10 +237,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before page handler executing. + /// public sealed class BeforePageFilterOnPageHandlerExecutingEventData : EventData { + /// + /// Name of the event. + /// public const string EventName = EventNamespace + "BeforeOnPageHandlerExecuting"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforePageFilterOnPageHandlerExecutingEventData(CompiledPageActionDescriptor actionDescriptor, PageHandlerExecutingContext handlerExecutingContext, IPageFilter filter) { ActionDescriptor = actionDescriptor; @@ -133,12 +260,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The . + /// public CompiledPageActionDescriptor ActionDescriptor { get; } + + /// + /// The . + /// public PageHandlerExecutingContext HandlerExecutingContext { get; } + + /// + /// The . + /// public IPageFilter Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -148,10 +288,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after page handler executing. + /// public sealed class AfterPageFilterOnPageHandlerExecutingEventData : EventData { + /// + /// Name of the event. + /// public const string EventName = EventNamespace + "AfterOnPageHandlerExecuting"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterPageFilterOnPageHandlerExecutingEventData(CompiledPageActionDescriptor actionDescriptor, PageHandlerExecutingContext handlerExecutingContext, IPageFilter filter) { ActionDescriptor = actionDescriptor; @@ -159,12 +311,26 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The . + /// public CompiledPageActionDescriptor ActionDescriptor { get; } + + /// + /// The . + /// + public PageHandlerExecutingContext HandlerExecutingContext { get; } + + /// + /// The . + /// public IPageFilter Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -174,10 +340,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before page handler executed. + /// public sealed class BeforePageFilterOnPageHandlerExecutedEventData : EventData { + /// + /// Name of the event. + /// public const string EventName = EventNamespace + "BeforeOnPageHandlerExecuted"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforePageFilterOnPageHandlerExecutedEventData(CompiledPageActionDescriptor actionDescriptor, PageHandlerExecutedContext handlerExecutedContext, IPageFilter filter) { ActionDescriptor = actionDescriptor; @@ -185,12 +363,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The . + /// public CompiledPageActionDescriptor ActionDescriptor { get; } + + /// + /// The . + /// public PageHandlerExecutedContext HandlerExecutedContext { get; } + + /// + /// The . + /// public IPageFilter Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -200,10 +391,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after page handler executed. + /// public sealed class AfterPageFilterOnPageHandlerExecutedEventData : EventData { + /// + /// Name of the event. + /// public const string EventName = EventNamespace + "AfterOnPageHandlerExecuted"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterPageFilterOnPageHandlerExecutedEventData(CompiledPageActionDescriptor actionDescriptor, PageHandlerExecutedContext handlerExecutedContext, IPageFilter filter) { ActionDescriptor = actionDescriptor; @@ -211,12 +414,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The . + /// public CompiledPageActionDescriptor ActionDescriptor { get; } + + /// + /// The . + /// public PageHandlerExecutedContext HandlerExecutedContext { get; } + + /// + /// The . + /// public IPageFilter Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -226,10 +442,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before page handler selection. + /// public sealed class BeforePageFilterOnPageHandlerSelectionEventData : EventData { + /// + /// Name of the event. + /// public const string EventName = EventNamespace + "BeforeOnPageHandlerSelection"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforePageFilterOnPageHandlerSelectionEventData(CompiledPageActionDescriptor actionDescriptor, PageHandlerSelectedContext handlerSelectedContext, IAsyncPageFilter filter) { ActionDescriptor = actionDescriptor; @@ -237,12 +465,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The . + /// public CompiledPageActionDescriptor ActionDescriptor { get; } + + /// + /// The . + /// public PageHandlerSelectedContext HandlerSelectedContext { get; } + + /// + /// The . + /// public IAsyncPageFilter Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -252,10 +493,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after page handler selection. + /// public sealed class AfterPageFilterOnPageHandlerSelectionEventData : EventData { + /// + /// Name of the event. + /// public const string EventName = EventNamespace + "AfterOnPageHandlerSelection"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public AfterPageFilterOnPageHandlerSelectionEventData(CompiledPageActionDescriptor actionDescriptor, PageHandlerSelectedContext handlerSelectedContext, IAsyncPageFilter filter) { ActionDescriptor = actionDescriptor; @@ -263,12 +516,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The . + /// public CompiledPageActionDescriptor ActionDescriptor { get; } + + /// + /// The . + /// public PageHandlerSelectedContext HandlerSelectedContext { get; } + + /// + /// The . + /// public IAsyncPageFilter Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -278,10 +544,22 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs before . + /// public sealed class BeforePageFilterOnPageHandlerSelectedEventData : EventData { + /// + /// Name of the event. + /// public const string EventName = EventNamespace + "BeforeOnPageHandlerSelected"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . public BeforePageFilterOnPageHandlerSelectedEventData(CompiledPageActionDescriptor actionDescriptor, PageHandlerSelectedContext handlerSelectedContext, IPageFilter filter) { ActionDescriptor = actionDescriptor; @@ -289,12 +567,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The . + /// public CompiledPageActionDescriptor ActionDescriptor { get; } + + /// + /// The . + /// public PageHandlerSelectedContext HandlerSelectedContext { get; } + + /// + /// The . + /// public IPageFilter Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -304,10 +595,23 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics }; } + /// + /// An that occurs after . + /// public sealed class AfterPageFilterOnPageHandlerSelectedEventData : EventData { + /// + /// Name of the event. + /// public const string EventName = EventNamespace + "AfterOnPageHandlerSelected"; + /// + /// Initializes a new instance of . + /// + /// The . + /// The . + /// The . + public AfterPageFilterOnPageHandlerSelectedEventData(CompiledPageActionDescriptor actionDescriptor, PageHandlerSelectedContext handlerSelectedContext, IPageFilter filter) { ActionDescriptor = actionDescriptor; @@ -315,12 +619,25 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics Filter = filter; } + /// + /// The . + /// public CompiledPageActionDescriptor ActionDescriptor { get; } + + /// + /// The . + /// public PageHandlerSelectedContext HandlerSelectedContext { get; } + + /// + /// The . + /// public IPageFilter Filter { get; } + /// protected override int Count => 3; + /// protected override KeyValuePair this[int index] => index switch { 0 => new KeyValuePair(nameof(ActionDescriptor), ActionDescriptor), @@ -329,4 +646,4 @@ namespace Microsoft.AspNetCore.Mvc.Diagnostics _ => throw new IndexOutOfRangeException(nameof(index)) }; } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.RazorPages/src/Infrastructure/HandlerMethodDescriptor.cs b/src/Mvc/Mvc.RazorPages/src/Infrastructure/HandlerMethodDescriptor.cs index 5372a5d5fa..7e651ee0af 100644 --- a/src/Mvc/Mvc.RazorPages/src/Infrastructure/HandlerMethodDescriptor.cs +++ b/src/Mvc/Mvc.RazorPages/src/Infrastructure/HandlerMethodDescriptor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; @@ -6,14 +6,29 @@ using System.Reflection; namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure { + /// + /// Represents a description of a handler method. + /// public class HandlerMethodDescriptor { + /// + /// Gets or sets the . + /// public MethodInfo MethodInfo { get; set; } + /// + /// Gets or sets the http method. + /// public string HttpMethod { get; set; } + /// + /// Gets or sets the name. + /// public string Name { get; set; } + /// + /// Gets or sets the parameters for the method. + /// public IList Parameters { get; set; } } } diff --git a/src/Mvc/Mvc.RazorPages/src/Infrastructure/HandlerParameterDescriptor.cs b/src/Mvc/Mvc.RazorPages/src/Infrastructure/HandlerParameterDescriptor.cs index 099b86192c..7ba0285efa 100644 --- a/src/Mvc/Mvc.RazorPages/src/Infrastructure/HandlerParameterDescriptor.cs +++ b/src/Mvc/Mvc.RazorPages/src/Infrastructure/HandlerParameterDescriptor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Reflection; @@ -7,6 +7,9 @@ using Microsoft.AspNetCore.Mvc.Infrastructure; namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure { + /// + /// Describes an handler parameter. + /// public class HandlerParameterDescriptor : ParameterDescriptor, IParameterInfoParameterDescriptor { /// diff --git a/src/Mvc/Mvc.RazorPages/src/Infrastructure/IPageHandlerMethodSelector.cs b/src/Mvc/Mvc.RazorPages/src/Infrastructure/IPageHandlerMethodSelector.cs index 06ae8f1f73..b396778a87 100644 --- a/src/Mvc/Mvc.RazorPages/src/Infrastructure/IPageHandlerMethodSelector.cs +++ b/src/Mvc/Mvc.RazorPages/src/Infrastructure/IPageHandlerMethodSelector.cs @@ -1,10 +1,18 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure { + /// + /// Selects a handler method from a page. + /// public interface IPageHandlerMethodSelector { + /// + /// Selects a handler method from a page. + /// + /// The . + /// The selected . HandlerMethodDescriptor Select(PageContext context); } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.RazorPages/src/Infrastructure/PageActionDescriptorProvider.cs b/src/Mvc/Mvc.RazorPages/src/Infrastructure/PageActionDescriptorProvider.cs index 23a449e731..c78018a5ea 100644 --- a/src/Mvc/Mvc.RazorPages/src/Infrastructure/PageActionDescriptorProvider.cs +++ b/src/Mvc/Mvc.RazorPages/src/Infrastructure/PageActionDescriptorProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -13,12 +13,21 @@ using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure { + /// + /// A for PageActions + /// public class PageActionDescriptorProvider : IActionDescriptorProvider { private readonly IPageRouteModelProvider[] _routeModelProviders; private readonly MvcOptions _mvcOptions; private readonly IPageRouteModelConvention[] _conventions; + /// + /// Instantiates a new instance of . + /// + /// The s to use. + /// The . + /// The . public PageActionDescriptorProvider( IEnumerable pageRouteModelProviders, IOptions mvcOptionsAccessor, @@ -32,8 +41,10 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure .ToArray(); } + /// public int Order { get; set; } = -900; // Run after the default MVC provider, but before others. + /// public void OnProvidersExecuting(ActionDescriptorProviderContext context) { var pageRouteModels = BuildModel(); @@ -44,6 +55,10 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure } } + /// + /// Build the model. + /// + /// The list of . protected IList BuildModel() { var context = new PageRouteModelProviderContext(); @@ -61,6 +76,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure return context.RouteModels; } + /// public void OnProvidersExecuted(ActionDescriptorProviderContext context) { } @@ -140,4 +156,4 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure return AttributeRouteModel.CombineTemplates(transformedPageRoute, pageRouteMetadata.RouteTemplate); } } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.RazorPages/src/Infrastructure/PageBoundPropertyDescriptor.cs b/src/Mvc/Mvc.RazorPages/src/Infrastructure/PageBoundPropertyDescriptor.cs index cb02222300..76d3f92cf8 100644 --- a/src/Mvc/Mvc.RazorPages/src/Infrastructure/PageBoundPropertyDescriptor.cs +++ b/src/Mvc/Mvc.RazorPages/src/Infrastructure/PageBoundPropertyDescriptor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Reflection; @@ -7,6 +7,9 @@ using Microsoft.AspNetCore.Mvc.Infrastructure; namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure { + /// + /// Describes a page bound property. + /// public class PageBoundPropertyDescriptor : ParameterDescriptor, IPropertyInfoParameterDescriptor { /// diff --git a/src/Mvc/Mvc.RazorPages/src/Infrastructure/PageViewLocationExpander.cs b/src/Mvc/Mvc.RazorPages/src/Infrastructure/PageViewLocationExpander.cs index 974bb5f99a..6654251beb 100644 --- a/src/Mvc/Mvc.RazorPages/src/Infrastructure/PageViewLocationExpander.cs +++ b/src/Mvc/Mvc.RazorPages/src/Infrastructure/PageViewLocationExpander.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Collections.Generic; @@ -6,8 +6,12 @@ using Microsoft.AspNetCore.Mvc.Razor; namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure { + /// + /// An for PageView. + /// public class PageViewLocationExpander : IViewLocationExpander { + /// public IEnumerable ExpandViewLocations(ViewLocationExpanderContext context, IEnumerable viewLocations) { if ((context.ActionContext.ActionDescriptor is PageActionDescriptor) && !string.IsNullOrEmpty(context.PageName)) @@ -61,6 +65,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure } } + /// public void PopulateValues(ViewLocationExpanderContext context) { // The value we care about - 'page' is already part of the system. We don't need to add it manually. diff --git a/src/Mvc/Mvc.RazorPages/src/Infrastructure/RazorPageAdapter.cs b/src/Mvc/Mvc.RazorPages/src/Infrastructure/RazorPageAdapter.cs index 116a67f679..ff3bc1fa4d 100644 --- a/src/Mvc/Mvc.RazorPages/src/Infrastructure/RazorPageAdapter.cs +++ b/src/Mvc/Mvc.RazorPages/src/Infrastructure/RazorPageAdapter.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -10,64 +10,79 @@ using Microsoft.AspNetCore.Mvc.Rendering; namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure { - // Implements IRazorPage so that RazorPageBase-derived classes don't get activated twice. - // - // The page gets activated before handler methods run, but the RazorView will also activate - // each page. + /// + /// Implements IRazorPage so that RazorPageBase-derived classes don't get activated twice. + /// The page gets activated before handler methods run, but the RazorView will also activate + /// each page. + /// public class RazorPageAdapter : IRazorPage, IModelTypeProvider { private readonly RazorPageBase _page; private readonly Type _modelType; + /// + /// Instantiates a new instance of . + /// + /// The . + /// The model type. public RazorPageAdapter(RazorPageBase page, Type modelType) { _page = page ?? throw new ArgumentNullException(nameof(page)); _modelType = modelType ?? throw new ArgumentNullException(nameof(modelType)); } + /// public ViewContext ViewContext { get { return _page.ViewContext; } set { _page.ViewContext = value; } } + /// public IHtmlContent BodyContent { get { return _page.BodyContent; } set { _page.BodyContent = value; } } + /// public bool IsLayoutBeingRendered { get { return _page.IsLayoutBeingRendered; } set { _page.IsLayoutBeingRendered = value; } } + /// public string Path { get { return _page.Path; } set { _page.Path = value; } } + /// public string Layout { get { return _page.Layout; } set { _page.Layout = value; } } + /// public IDictionary PreviousSectionWriters { get { return _page.PreviousSectionWriters; } set { _page.PreviousSectionWriters = value; } } + /// public IDictionary SectionWriters => _page.SectionWriters; + /// public void EnsureRenderedBodyOrSections() { _page.EnsureRenderedBodyOrSections(); } + /// public Task ExecuteAsync() { return _page.ExecuteAsync(); diff --git a/src/Mvc/Mvc.RazorPages/src/Infrastructure/RazorPageAttribute.cs b/src/Mvc/Mvc.RazorPages/src/Infrastructure/RazorPageAttribute.cs index 2fe3030064..63e343d487 100644 --- a/src/Mvc/Mvc.RazorPages/src/Infrastructure/RazorPageAttribute.cs +++ b/src/Mvc/Mvc.RazorPages/src/Infrastructure/RazorPageAttribute.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -6,15 +6,27 @@ using Microsoft.AspNetCore.Mvc.Razor.Compilation; namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure { + /// + /// Obsolete: This attribute has been superseded by RazorCompiledItem and will not be used by the runtime. + /// [Obsolete("This attribute has been superseded by RazorCompiledItem and will not be used by the runtime.")] public class RazorPageAttribute : RazorViewAttribute { + /// + /// This attribute has been superseded by RazorCompiledItem and will not be used by the runtime. + /// + /// + /// + /// public RazorPageAttribute(string path, Type viewType, string routeTemplate) : base(path, viewType) { RouteTemplate = routeTemplate; } + /// + /// The route template. + /// public string RouteTemplate { get; } } } diff --git a/src/Mvc/Mvc.RazorPages/src/Infrastructure/ServiceBasedPageModelActivatorProvider.cs b/src/Mvc/Mvc.RazorPages/src/Infrastructure/ServiceBasedPageModelActivatorProvider.cs index 262d0cab21..f43c3f3eb7 100644 --- a/src/Mvc/Mvc.RazorPages/src/Infrastructure/ServiceBasedPageModelActivatorProvider.cs +++ b/src/Mvc/Mvc.RazorPages/src/Infrastructure/ServiceBasedPageModelActivatorProvider.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -12,6 +12,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure /// public class ServiceBasedPageModelActivatorProvider : IPageModelActivatorProvider { + /// public Func CreateActivator(CompiledPageActionDescriptor descriptor) { if (descriptor == null) @@ -34,6 +35,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure }; } + /// public Action CreateReleaser(CompiledPageActionDescriptor descriptor) { return null; diff --git a/src/Mvc/Mvc.RazorPages/src/Microsoft.AspNetCore.Mvc.RazorPages.csproj b/src/Mvc/Mvc.RazorPages/src/Microsoft.AspNetCore.Mvc.RazorPages.csproj index b38018a13b..dc6ea543c5 100644 --- a/src/Mvc/Mvc.RazorPages/src/Microsoft.AspNetCore.Mvc.RazorPages.csproj +++ b/src/Mvc/Mvc.RazorPages/src/Microsoft.AspNetCore.Mvc.RazorPages.csproj @@ -1,10 +1,10 @@ - + ASP.NET Core MVC Razor Pages. $(DefaultNetCoreTargetFramework) true - $(NoWarn);CS1591 + $(NoWarn.Replace('1591', '')) true aspnetcore;aspnetcoremvc;cshtml;razor false diff --git a/src/Mvc/Mvc.RazorPages/src/PageActionDescriptor.cs b/src/Mvc/Mvc.RazorPages/src/PageActionDescriptor.cs index 57a2a17cb2..8241a99aa1 100644 --- a/src/Mvc/Mvc.RazorPages/src/PageActionDescriptor.cs +++ b/src/Mvc/Mvc.RazorPages/src/PageActionDescriptor.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -7,6 +7,9 @@ using Microsoft.AspNetCore.Mvc.Abstractions; namespace Microsoft.AspNetCore.Mvc.RazorPages { + /// + /// Describes a page action. + /// [DebuggerDisplay("{DebuggerDisplayString,nq}")] public class PageActionDescriptor : ActionDescriptor { @@ -83,4 +86,4 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages private string DebuggerDisplayString => $"{nameof(ViewEnginePath)} = {ViewEnginePath}, {nameof(RelativePath)} = {RelativePath}"; } -} \ No newline at end of file +} diff --git a/src/Mvc/Mvc.RazorPages/src/PageModel.cs b/src/Mvc/Mvc.RazorPages/src/PageModel.cs index 9821bb3a93..f539f7848a 100644 --- a/src/Mvc/Mvc.RazorPages/src/PageModel.cs +++ b/src/Mvc/Mvc.RazorPages/src/PageModel.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -21,6 +21,9 @@ using Microsoft.Net.Http.Headers; namespace Microsoft.AspNetCore.Mvc.RazorPages { + /// + /// Abstract class representing a Page + /// [PageModel] public abstract class PageModel : IAsyncPageFilter, IPageFilter { diff --git a/src/Mvc/Mvc.TagHelpers/src/Microsoft.AspNetCore.Mvc.TagHelpers.csproj b/src/Mvc/Mvc.TagHelpers/src/Microsoft.AspNetCore.Mvc.TagHelpers.csproj index 4d31ad0585..29a6c90afc 100644 --- a/src/Mvc/Mvc.TagHelpers/src/Microsoft.AspNetCore.Mvc.TagHelpers.csproj +++ b/src/Mvc/Mvc.TagHelpers/src/Microsoft.AspNetCore.Mvc.TagHelpers.csproj @@ -1,4 +1,4 @@ - + ASP.NET Core MVC default tag helpers. Contains tag helpers for anchor tags, HTML input elements, caching, scripts, links (for CSS), and more. @@ -7,6 +7,7 @@ aspnetcore;aspnetcoremvc;taghelper;taghelpers true false + $(NoWarn.Replace('1591', '')) diff --git a/src/Mvc/Mvc.Testing/src/Microsoft.AspNetCore.Mvc.Testing.csproj b/src/Mvc/Mvc.Testing/src/Microsoft.AspNetCore.Mvc.Testing.csproj index 8d08f6ca61..dd2f1eed73 100644 --- a/src/Mvc/Mvc.Testing/src/Microsoft.AspNetCore.Mvc.Testing.csproj +++ b/src/Mvc/Mvc.Testing/src/Microsoft.AspNetCore.Mvc.Testing.csproj @@ -1,8 +1,8 @@ - + Support for writing functional tests for MVC applications. $(DefaultNetCoreTargetFramework) - $(NoWarn);CS1591 + $(NoWarn.Replace('1591', '')) true aspnetcore;aspnetcoremvc;aspnetcoremvctesting