From 2b4702728d48ee6c34727afa09255c0e7c17b6f9 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Wed, 6 May 2015 14:42:13 -0700 Subject: [PATCH] Fix #1910 - Review and improve docs for 'Order' properties --- .../IActionConstraint.cs | 4 +++ .../IActionConstraintProvider.cs | 21 ++++++++++++++ .../IFilterProvider.cs | 21 ++++++++++++++ .../IOrderedFilter.cs | 28 +++++++++++++++++++ .../IApiDescriptionProvider.cs | 21 ++++++++++++++ .../IActionDescriptorProvider.cs | 21 ++++++++++++++ .../IActionInvokerProvider.cs | 21 ++++++++++++++ 7 files changed, 137 insertions(+) diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IActionConstraint.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IActionConstraint.cs index da5bf720a9..52268fd3f3 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IActionConstraint.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IActionConstraint.cs @@ -39,6 +39,10 @@ namespace Microsoft.AspNet.Mvc /// /// The constraint order. /// + /// + /// Constraints are grouped into stages by the value of . See remarks on + /// . + /// int Order { get; } /// diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IActionConstraintProvider.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IActionConstraintProvider.cs index 9f3d484b8c..7460acdf18 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IActionConstraintProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IActionConstraintProvider.cs @@ -7,8 +7,29 @@ namespace Microsoft.AspNet.Mvc.ActionConstraints { public interface IActionConstraintProvider { + /// + /// Gets the order value for determining the order of execution of providers. Providers execute in + /// ascending numeric value of the property. + /// + /// + /// + /// Providers are executed in an ordering determined by an ascending sort of the property. + /// A provider with a lower numeric value of will have its + /// called before that of a provider with a higher numeric value of + /// . The method is called in the reverse ordering after + /// all calls to . A provider with a lower numeric value of + /// will have its method called after that of a provider + /// with a higher numeric value of . + /// + /// + /// If two providers have the same numeric value of , then their relative execution order + /// is undefined. + /// + /// int Order { get; } + void OnProvidersExecuting([NotNull] ActionConstraintProviderContext context); + void OnProvidersExecuted([NotNull] ActionConstraintProviderContext context); } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IFilterProvider.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IFilterProvider.cs index e604e0cbe7..fed2209fd1 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IFilterProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IFilterProvider.cs @@ -7,8 +7,29 @@ namespace Microsoft.AspNet.Mvc.Core { public interface IFilterProvider { + /// + /// Gets the order value for determining the order of execution of providers. Providers execute in + /// ascending numeric value of the property. + /// + /// + /// + /// Providers are executed in an ordering determined by an ascending sort of the property. + /// A provider with a lower numeric value of will have its + /// called before that of a provider with a higher numeric value of + /// . The method is called in the reverse ordering after + /// all calls to . A provider with a lower numeric value of + /// will have its method called after that of a provider + /// with a higher numeric value of . + /// + /// + /// If two providers have the same numeric value of , then their relative execution order + /// is undefined. + /// + /// int Order { get; } + void OnProvidersExecuting([NotNull] FilterProviderContext context); + void OnProvidersExecuted([NotNull] FilterProviderContext context); } } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IOrderedFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IOrderedFilter.cs index ae1852ee9a..8eb77844ff 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IOrderedFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IOrderedFilter.cs @@ -5,6 +5,34 @@ namespace Microsoft.AspNet.Mvc { public interface IOrderedFilter : IFilter { + /// + /// Gets the order value for determining the order of execution of filters. Filters execute in + /// ascending numeric value of the property. + /// + /// + /// + /// Filters are executed in an ordering determined by an ascending sort of the property. + /// + /// + /// Asynchronous filters, such as , surround the execution of subsequent + /// filters of the same filter kind. An asynchronous filter with a lower numeric + /// value will have its filter method, such as , + /// executed before that of a filter with a higher value of . + /// + /// + /// Synchronous filters, such as , have a before-method, such as + /// , and an after-method, such as + /// . A synchronous filter with a lower numeric + /// value will have its before-method executed before that of a filter with a higher value of + /// . During the after-stage of the filter, a synchronous filter with a lower + /// numeric value will have its after-method executed after that of a filter with a higher + /// value of . + /// + /// + /// If two filters have the same numeric value of , then their relative execution order + /// is determined by the filter scope. + /// + /// int Order { get; } } } diff --git a/src/Microsoft.AspNet.Mvc.ApiExplorer/IApiDescriptionProvider.cs b/src/Microsoft.AspNet.Mvc.ApiExplorer/IApiDescriptionProvider.cs index 0db379d0d0..93a781a26b 100644 --- a/src/Microsoft.AspNet.Mvc.ApiExplorer/IApiDescriptionProvider.cs +++ b/src/Microsoft.AspNet.Mvc.ApiExplorer/IApiDescriptionProvider.cs @@ -7,8 +7,29 @@ namespace Microsoft.AspNet.Mvc.ApiExplorer { public interface IApiDescriptionProvider { + /// + /// Gets the order value for determining the order of execution of providers. Providers execute in + /// ascending numeric value of the property. + /// + /// + /// + /// Providers are executed in an ordering determined by an ascending sort of the property. + /// A provider with a lower numeric value of will have its + /// called before that of a provider with a higher numeric value of + /// . The method is called in the reverse ordering after + /// all calls to . A provider with a lower numeric value of + /// will have its method called after that of a provider + /// with a higher numeric value of . + /// + /// + /// If two providers have the same numeric value of , then their relative execution order + /// is undefined. + /// + /// int Order { get; } + void OnProvidersExecuting([NotNull] ApiDescriptionProviderContext context); + void OnProvidersExecuted([NotNull] ApiDescriptionProviderContext context); } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.Mvc.Core/IActionDescriptorProvider.cs b/src/Microsoft.AspNet.Mvc.Core/IActionDescriptorProvider.cs index 3a97886183..88a6eda28c 100644 --- a/src/Microsoft.AspNet.Mvc.Core/IActionDescriptorProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/IActionDescriptorProvider.cs @@ -7,8 +7,29 @@ namespace Microsoft.AspNet.Mvc.Core { public interface IActionDescriptorProvider { + /// + /// Gets the order value for determining the order of execution of providers. Providers execute in + /// ascending numeric value of the property. + /// + /// + /// + /// Providers are executed in an ordering determined by an ascending sort of the property. + /// A provider with a lower numeric value of will have its + /// called before that of a provider with a higher numeric value of + /// . The method is called in the reverse ordering after + /// all calls to . A provider with a lower numeric value of + /// will have its method called after that of a provider + /// with a higher numeric value of . + /// + /// + /// If two providers have the same numeric value of , then their relative execution order + /// is undefined. + /// + /// int Order { get; } + void OnProvidersExecuting([NotNull] ActionDescriptorProviderContext context); + void OnProvidersExecuted([NotNull] ActionDescriptorProviderContext context); } } diff --git a/src/Microsoft.AspNet.Mvc.Core/IActionInvokerProvider.cs b/src/Microsoft.AspNet.Mvc.Core/IActionInvokerProvider.cs index 5aebc4b610..f00f03d915 100644 --- a/src/Microsoft.AspNet.Mvc.Core/IActionInvokerProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/IActionInvokerProvider.cs @@ -7,8 +7,29 @@ namespace Microsoft.AspNet.Mvc.Core { public interface IActionInvokerProvider { + /// + /// Gets the order value for determining the order of execution of providers. Providers execute in + /// ascending numeric value of the property. + /// + /// + /// + /// Providers are executed in an ordering determined by an ascending sort of the property. + /// A provider with a lower numeric value of will have its + /// called before that of a provider with a higher numeric value of + /// . The method is called in the reverse ordering after + /// all calls to . A provider with a lower numeric value of + /// will have its method called after that of a provider + /// with a higher numeric value of . + /// + /// + /// If two providers have the same numeric value of , then their relative execution order + /// is undefined. + /// + /// int Order { get; } + void OnProvidersExecuting([NotNull] ActionInvokerProviderContext context); + void OnProvidersExecuted([NotNull] ActionInvokerProviderContext context); } }