diff --git a/samples/MvcSample.Web/Filters/InspectResultPageAttribute.cs b/samples/MvcSample.Web/Filters/InspectResultPageAttribute.cs index 528e9885f3..c3f2b2ce75 100644 --- a/samples/MvcSample.Web/Filters/InspectResultPageAttribute.cs +++ b/samples/MvcSample.Web/Filters/InspectResultPageAttribute.cs @@ -10,7 +10,7 @@ namespace MvcSample.Web.Filters [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true, Inherited = true)] public class InspectResultPageAttribute : Attribute, IFilterFactory { - public IFilter CreateInstance(IServiceProvider serviceProvider) + public IFilterMetadata CreateInstance(IServiceProvider serviceProvider) { return new InspectResultPageFilter(); } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/ActionExecutedContext.cs b/src/Microsoft.AspNet.Mvc.Abstractions/ActionExecutedContext.cs index 9a51ee3dec..86174e8b22 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/ActionExecutedContext.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/ActionExecutedContext.cs @@ -15,7 +15,7 @@ namespace Microsoft.AspNet.Mvc public ActionExecutedContext( [NotNull] ActionContext actionContext, - [NotNull] IList filters, + [NotNull] IList filters, object controller) : base(actionContext, filters) { diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/ActionExecutingContext.cs b/src/Microsoft.AspNet.Mvc.Abstractions/ActionExecutingContext.cs index 5f7785ba2d..d62a61ba5e 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/ActionExecutingContext.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/ActionExecutingContext.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc { public ActionExecutingContext( [NotNull] ActionContext actionContext, - [NotNull] IList filters, + [NotNull] IList filters, [NotNull] IDictionary actionArguments, object controller) : base(actionContext, filters) diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/AuthorizationContext.cs b/src/Microsoft.AspNet.Mvc.Abstractions/AuthorizationContext.cs index 697faf1c39..45b79bb3b7 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/AuthorizationContext.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/AuthorizationContext.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc { public AuthorizationContext( [NotNull] ActionContext actionContext, - [NotNull] IList filters) + [NotNull] IList filters) : base(actionContext, filters) { } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/ExceptionContext.cs b/src/Microsoft.AspNet.Mvc.Abstractions/ExceptionContext.cs index 5a7b1c2b9c..3c7945b482 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/ExceptionContext.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/ExceptionContext.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc private Exception _exception; private ExceptionDispatchInfo _exceptionDispatchInfo; - public ExceptionContext([NotNull] ActionContext actionContext, [NotNull] IList filters) + public ExceptionContext([NotNull] ActionContext actionContext, [NotNull] IList filters) : base(actionContext, filters) { } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/FilterContext.cs b/src/Microsoft.AspNet.Mvc.Abstractions/FilterContext.cs index ec04ee9c47..a033983b63 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/FilterContext.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/FilterContext.cs @@ -10,12 +10,12 @@ namespace Microsoft.AspNet.Mvc { public FilterContext( [NotNull] ActionContext actionContext, - [NotNull] IList filters) + [NotNull] IList filters) : base(actionContext) { Filters = filters; } - public virtual IList Filters { get; private set; } + public virtual IList Filters { get; private set; } } } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/FilterDescriptor.cs b/src/Microsoft.AspNet.Mvc.Abstractions/FilterDescriptor.cs index f7dc46df9c..a8327938fc 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/FilterDescriptor.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/FilterDescriptor.cs @@ -6,10 +6,10 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc { /// - /// Descriptor for an . + /// Descriptor for an . /// /// - /// describes an with an order and scope. + /// describes an with an order and scope. /// /// Order and scope control the execution order of filters. Filters with a higher value of Order execute /// later in the pipeline. @@ -26,14 +26,14 @@ namespace Microsoft.AspNet.Mvc /// /// Creates a new . /// - /// The . + /// The . /// The filter scope. /// /// If the implements , then the value of /// will be taken from . Otherwise the value /// of will default to 0. /// - public FilterDescriptor([NotNull] IFilter filter, int filterScope) + public FilterDescriptor([NotNull] IFilterMetadata filter, int filterScope) { Filter = filter; Scope = filterScope; @@ -47,9 +47,9 @@ namespace Microsoft.AspNet.Mvc } /// - /// The instance. + /// The instance. /// - public IFilter Filter { get; private set; } + public IFilterMetadata Filter { get; private set; } /// /// The filter order. diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/FilterItem.cs b/src/Microsoft.AspNet.Mvc.Abstractions/FilterItem.cs index 90568f8dea..d0458116bc 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/FilterItem.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/FilterItem.cs @@ -15,7 +15,7 @@ namespace Microsoft.AspNet.Mvc Descriptor = descriptor; } - public FilterItem([NotNull] FilterDescriptor descriptor, [NotNull] IFilter filter) + public FilterItem([NotNull] FilterDescriptor descriptor, [NotNull] IFilterMetadata filter) : this(descriptor) { Filter = filter; @@ -23,6 +23,6 @@ namespace Microsoft.AspNet.Mvc public FilterDescriptor Descriptor { get; set; } - public IFilter Filter { get; set; } + public IFilterMetadata Filter { get; set; } } } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IActionFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IActionFilter.cs index 81df8597fb..edc5036116 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IActionFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IActionFilter.cs @@ -5,7 +5,7 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc { - public interface IActionFilter : IFilter + public interface IActionFilter : IFilterMetadata { void OnActionExecuting([NotNull] ActionExecutingContext context); diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncActionFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncActionFilter.cs index 79d01ccbae..1097643660 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncActionFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncActionFilter.cs @@ -6,7 +6,7 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc { - public interface IAsyncActionFilter : IFilter + public interface IAsyncActionFilter : IFilterMetadata { Task OnActionExecutionAsync([NotNull] ActionExecutingContext context, [NotNull] ActionExecutionDelegate next); } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncAuthorizationFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncAuthorizationFilter.cs index 89b602c90d..3007a7d42c 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncAuthorizationFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncAuthorizationFilter.cs @@ -6,7 +6,7 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc { - public interface IAsyncAuthorizationFilter : IFilter + public interface IAsyncAuthorizationFilter : IFilterMetadata { Task OnAuthorizationAsync([NotNull] AuthorizationContext context); } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncExceptionFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncExceptionFilter.cs index ee60746da7..0d8c9925f7 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncExceptionFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncExceptionFilter.cs @@ -6,7 +6,7 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc { - public interface IAsyncExceptionFilter : IFilter + public interface IAsyncExceptionFilter : IFilterMetadata { Task OnExceptionAsync([NotNull] ExceptionContext context); } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncResourceFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncResourceFilter.cs index 4f4a6cb964..fdb3d7fab5 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncResourceFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncResourceFilter.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc /// A filter which surrounds execution of model binding, the action (and filters) and the action result /// (and filters). /// - public interface IAsyncResourceFilter : IFilter + public interface IAsyncResourceFilter : IFilterMetadata { /// /// Executes the resource filter. diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncResultFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncResultFilter.cs index b0202a34e8..6a0a5a1292 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncResultFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IAsyncResultFilter.cs @@ -6,7 +6,7 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc { - public interface IAsyncResultFilter : IFilter + public interface IAsyncResultFilter : IFilterMetadata { Task OnResultExecutionAsync([NotNull] ResultExecutingContext context, [NotNull] ResultExecutionDelegate next); } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IAuthorizationFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IAuthorizationFilter.cs index f03e9092db..20eb70c425 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IAuthorizationFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IAuthorizationFilter.cs @@ -5,7 +5,7 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc { - public interface IAuthorizationFilter : IFilter + public interface IAuthorizationFilter : IFilterMetadata { void OnAuthorization([NotNull] AuthorizationContext context); } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IExceptionFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IExceptionFilter.cs index 9ffc08eb89..2b5954aee4 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IExceptionFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IExceptionFilter.cs @@ -5,7 +5,7 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc { - public interface IExceptionFilter : IFilter + public interface IExceptionFilter : IFilterMetadata { void OnException([NotNull] ExceptionContext context); } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IFilterContainer.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IFilterContainer.cs index 089409f078..ba6c3436b1 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IFilterContainer.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IFilterContainer.cs @@ -5,6 +5,6 @@ namespace Microsoft.AspNet.Mvc.Filters { public interface IFilterContainer { - IFilter FilterDefinition { get; set; } + IFilterMetadata FilterDefinition { get; set; } } } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IFilterFactory.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IFilterFactory.cs index 07f976d7d2..3cef633871 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IFilterFactory.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IFilterFactory.cs @@ -6,8 +6,8 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc { - public interface IFilterFactory : IFilter + public interface IFilterFactory : IFilterMetadata { - IFilter CreateInstance([NotNull] IServiceProvider serviceProvider); + IFilterMetadata CreateInstance([NotNull] IServiceProvider serviceProvider); } } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IFilterMetadata.cs similarity index 84% rename from src/Microsoft.AspNet.Mvc.Abstractions/IFilter.cs rename to src/Microsoft.AspNet.Mvc.Abstractions/IFilterMetadata.cs index c2d383d725..4af92c7959 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IFilterMetadata.cs @@ -3,7 +3,7 @@ namespace Microsoft.AspNet.Mvc { - public interface IFilter + public interface IFilterMetadata { } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IOrderedFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IOrderedFilter.cs index 8eb77844ff..d025f02d50 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IOrderedFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IOrderedFilter.cs @@ -3,7 +3,7 @@ namespace Microsoft.AspNet.Mvc { - public interface IOrderedFilter : IFilter + public interface IOrderedFilter : IFilterMetadata { /// /// Gets the order value for determining the order of execution of filters. Filters execute in diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IResourceFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IResourceFilter.cs index e119b14016..22fa619dcc 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IResourceFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IResourceFilter.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNet.Mvc /// A filter which surrounds execution of model binding, the action (and filters) and the action result /// (and filters). /// - public interface IResourceFilter : IFilter + public interface IResourceFilter : IFilterMetadata { /// /// Executes the resource filter. Called before execution of the remainder of the pipeline. diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/IResultFilter.cs b/src/Microsoft.AspNet.Mvc.Abstractions/IResultFilter.cs index fec38025b5..ab5b3d6100 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/IResultFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/IResultFilter.cs @@ -5,7 +5,7 @@ using Microsoft.Framework.Internal; namespace Microsoft.AspNet.Mvc { - public interface IResultFilter : IFilter + public interface IResultFilter : IFilterMetadata { void OnResultExecuting([NotNull] ResultExecutingContext context); diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/ResourceExecutedContext.cs b/src/Microsoft.AspNet.Mvc.Abstractions/ResourceExecutedContext.cs index 48eeefcab0..80a408dbc5 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/ResourceExecutedContext.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/ResourceExecutedContext.cs @@ -19,8 +19,8 @@ namespace Microsoft.AspNet.Mvc /// Creates a new . /// /// The . - /// The list of instances. - public ResourceExecutedContext(ActionContext actionContext, IList filters) + /// The list of instances. + public ResourceExecutedContext(ActionContext actionContext, IList filters) : base(actionContext, filters) { } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/ResourceExecutingContext.cs b/src/Microsoft.AspNet.Mvc.Abstractions/ResourceExecutingContext.cs index 234a378d76..fd2748124f 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/ResourceExecutingContext.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/ResourceExecutingContext.cs @@ -17,8 +17,8 @@ namespace Microsoft.AspNet.Mvc /// Creates a new . /// /// The . - /// The list of instances. - public ResourceExecutingContext(ActionContext actionContext, IList filters) + /// The list of instances. + public ResourceExecutingContext(ActionContext actionContext, IList filters) : base(actionContext, filters) { } diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/ResultExecutedContext.cs b/src/Microsoft.AspNet.Mvc.Abstractions/ResultExecutedContext.cs index 4f4c415588..4cf8d5328d 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/ResultExecutedContext.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/ResultExecutedContext.cs @@ -15,7 +15,7 @@ namespace Microsoft.AspNet.Mvc public ResultExecutedContext( [NotNull] ActionContext actionContext, - [NotNull] IList filters, + [NotNull] IList filters, [NotNull] IActionResult result, object controller) : base(actionContext, filters) diff --git a/src/Microsoft.AspNet.Mvc.Abstractions/ResultExecutingContext.cs b/src/Microsoft.AspNet.Mvc.Abstractions/ResultExecutingContext.cs index 6a69a9b432..8b566444f2 100644 --- a/src/Microsoft.AspNet.Mvc.Abstractions/ResultExecutingContext.cs +++ b/src/Microsoft.AspNet.Mvc.Abstractions/ResultExecutingContext.cs @@ -10,7 +10,7 @@ namespace Microsoft.AspNet.Mvc { public ResultExecutingContext( [NotNull] ActionContext actionContext, - [NotNull] IList filters, + [NotNull] IList filters, [NotNull] IActionResult result, object controller) : base(actionContext, filters) diff --git a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ActionModel.cs b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ActionModel.cs index d1f678e508..bf626caeb8 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ActionModel.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ActionModel.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels ApiExplorer = new ApiExplorerModel(); Attributes = new List(attributes); ActionConstraints = new List(); - Filters = new List(); + Filters = new List(); HttpMethods = new List(); Parameters = new List(); RouteConstraints = new List(); @@ -39,7 +39,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels // These are just metadata, safe to create new collections ActionConstraints = new List(other.ActionConstraints); Attributes = new List(other.Attributes); - Filters = new List(other.Filters); + Filters = new List(other.Filters); HttpMethods = new List(other.HttpMethods); Properties = new Dictionary(other.Properties); @@ -78,7 +78,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels public ControllerModel Controller { get; set; } - public IList Filters { get; private set; } + public IList Filters { get; private set; } public IList HttpMethods { get; private set; } diff --git a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ApplicationModel.cs b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ApplicationModel.cs index 37f76bdf8b..41e41bf508 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ApplicationModel.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ApplicationModel.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels { ApiExplorer = new ApiExplorerModel(); Controllers = new List(); - Filters = new List(); + Filters = new List(); Properties = new Dictionary(); } @@ -32,7 +32,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels public IList Controllers { get; private set; } - public IList Filters { get; private set; } + public IList Filters { get; private set; } /// /// Gets a set of properties associated with all actions. diff --git a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ControllerModel.cs b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ControllerModel.cs index 0ad4b16376..f97e644f56 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ControllerModel.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/ControllerModel.cs @@ -23,7 +23,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels Attributes = new List(attributes); AttributeRoutes = new List(); ActionConstraints = new List(); - Filters = new List(); + Filters = new List(); RouteConstraints = new List(); Properties = new Dictionary(); ControllerProperties = new List(); @@ -40,7 +40,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels // These are just metadata, safe to create new collections ActionConstraints = new List(other.ActionConstraints); Attributes = new List(other.Attributes); - Filters = new List(other.Filters); + Filters = new List(other.Filters); RouteConstraints = new List(other.RouteConstraints); Properties = new Dictionary(other.Properties); @@ -81,7 +81,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels public IList ControllerProperties { get; } - public IList Filters { get; private set; } + public IList Filters { get; private set; } public IList RouteConstraints { get; private set; } diff --git a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultApplicationModelProvider.cs b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultApplicationModelProvider.cs index a49401c024..eef1f60733 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultApplicationModelProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ApplicationModels/DefaultApplicationModelProvider.cs @@ -16,7 +16,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels { public class DefaultApplicationModelProvider : IApplicationModelProvider { - private readonly ICollection _globalFilters; + private readonly ICollection _globalFilters; public DefaultApplicationModelProvider(IOptions mvcOptionsAccessor) { @@ -173,7 +173,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels typeInfo.Name; AddRange(controllerModel.ActionConstraints, attributes.OfType()); - AddRange(controllerModel.Filters, attributes.OfType()); + AddRange(controllerModel.Filters, attributes.OfType()); AddRange(controllerModel.RouteConstraints, attributes.OfType()); var apiVisibility = attributes.OfType().FirstOrDefault(); @@ -503,7 +503,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels var actionModel = new ActionModel(methodInfo, attributes); AddRange(actionModel.ActionConstraints, attributes.OfType()); - AddRange(actionModel.Filters, attributes.OfType()); + AddRange(actionModel.Filters, attributes.OfType()); var actionName = attributes.OfType().FirstOrDefault(); if (actionName?.Name != null) diff --git a/src/Microsoft.AspNet.Mvc.Core/ControllerActionDescriptorBuilder.cs b/src/Microsoft.AspNet.Mvc.Core/ControllerActionDescriptorBuilder.cs index ab2e5b0d3f..f1f892d0f7 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ControllerActionDescriptorBuilder.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ControllerActionDescriptorBuilder.cs @@ -373,9 +373,9 @@ namespace Microsoft.AspNet.Mvc private static void AddActionFilters( ControllerActionDescriptor actionDescriptor, - IEnumerable actionFilters, - IEnumerable controllerFilters, - IEnumerable globalFilters) + IEnumerable actionFilters, + IEnumerable controllerFilters, + IEnumerable globalFilters) { actionDescriptor.FilterDescriptors = actionFilters.Select(f => new FilterDescriptor(f, FilterScope.Action)) diff --git a/src/Microsoft.AspNet.Mvc.Core/DefaultFilterProvider.cs b/src/Microsoft.AspNet.Mvc.Core/DefaultFilterProvider.cs index 6d2c0ae413..f464be9145 100644 --- a/src/Microsoft.AspNet.Mvc.Core/DefaultFilterProvider.cs +++ b/src/Microsoft.AspNet.Mvc.Core/DefaultFilterProvider.cs @@ -62,7 +62,7 @@ namespace Microsoft.AspNet.Mvc.Filters } } - private void ApplyFilterToContainer(object actualFilter, IFilter filterMetadata) + private void ApplyFilterToContainer(object actualFilter, IFilterMetadata filterMetadata) { Debug.Assert(actualFilter != null, "actualFilter should not be null"); Debug.Assert(filterMetadata != null, "filterMetadata should not be null"); diff --git a/src/Microsoft.AspNet.Mvc.Core/FilterActionInvoker.cs b/src/Microsoft.AspNet.Mvc.Core/FilterActionInvoker.cs index 7d5d8a8fbd..2bb3fbcd70 100644 --- a/src/Microsoft.AspNet.Mvc.Core/FilterActionInvoker.cs +++ b/src/Microsoft.AspNet.Mvc.Core/FilterActionInvoker.cs @@ -26,7 +26,7 @@ namespace Microsoft.AspNet.Mvc.Core private readonly ILogger _logger; private readonly int _maxModelValidationErrors; - private IFilter[] _filters; + private IFilterMetadata[] _filters; private FilterCursor _cursor; private AuthorizationContext _authorizationContext; @@ -162,7 +162,7 @@ namespace Microsoft.AspNet.Mvc.Core } } - private IFilter[] GetFilters() + private IFilterMetadata[] GetFilters() { var context = new FilterProviderContext( ActionContext, @@ -759,16 +759,16 @@ namespace Microsoft.AspNet.Mvc.Core { private FilterStage _stage; private int _index; - private readonly IFilter[] _filters; + private readonly IFilterMetadata[] _filters; - public FilterCursor(FilterStage stage, int index, IFilter[] filters) + public FilterCursor(FilterStage stage, int index, IFilterMetadata[] filters) { _stage = stage; _index = index; _filters = filters; } - public FilterCursor(IFilter[] filters) + public FilterCursor(IFilterMetadata[] filters) { _stage = FilterStage.Undefined; _index = 0; diff --git a/src/Microsoft.AspNet.Mvc.Core/FilterCollectionExtensions.cs b/src/Microsoft.AspNet.Mvc.Core/FilterCollectionExtensions.cs index 90f37e088a..2654ccdc63 100644 --- a/src/Microsoft.AspNet.Mvc.Core/FilterCollectionExtensions.cs +++ b/src/Microsoft.AspNet.Mvc.Core/FilterCollectionExtensions.cs @@ -15,43 +15,43 @@ namespace Microsoft.AspNet.Mvc public static class FilterCollectionExtensions { /// - /// Adds a type representing an to a filter collection. + /// Adds a type representing an to a filter collection. /// - /// A collection of . - /// Type representing an . - /// An representing the added type. + /// A collection of . + /// Type representing an . + /// An representing the added type. /// /// Filter instances will be created using /// . - /// Use to register a service as a filter. + /// Use to register a service as a filter. /// - public static IFilter Add( - [NotNull] this ICollection filters, + public static IFilterMetadata Add( + [NotNull] this ICollection filters, [NotNull] Type filterType) { return Add(filters, filterType, order: 0); } /// - /// Adds a type representing an to a filter collection. + /// Adds a type representing an to a filter collection. /// - /// A collection of . - /// Type representing an . + /// A collection of . + /// Type representing an . /// The order of the added filter. - /// An representing the added type. + /// An representing the added type. /// /// Filter instances will be created using /// . - /// Use to register a service as a filter. + /// Use to register a service as a filter. /// - public static IFilter Add( - [NotNull] this ICollection filters, + public static IFilterMetadata Add( + [NotNull] this ICollection filters, [NotNull] Type filterType, int order) { - if (!typeof(IFilter).IsAssignableFrom(filterType)) + if (!typeof(IFilterMetadata).IsAssignableFrom(filterType)) { - var message = Resources.FormatTypeMustDeriveFromType(filterType.FullName, typeof(IFilter).FullName); + var message = Resources.FormatTypeMustDeriveFromType(filterType.FullName, typeof(IFilterMetadata).FullName); throw new ArgumentException(message, nameof(filterType)); } @@ -61,43 +61,43 @@ namespace Microsoft.AspNet.Mvc } /// - /// Adds a type representing an to a filter collection. + /// Adds a type representing an to a filter collection. /// - /// A collection of . - /// Type representing an . - /// An representing the added service type. + /// A collection of . + /// Type representing an . + /// An representing the added service type. /// /// Filter instances will created through dependency injection. Use - /// to register a service that will be created via + /// to register a service that will be created via /// type activation. /// - public static IFilter AddService( - [NotNull] this ICollection filters, + public static IFilterMetadata AddService( + [NotNull] this ICollection filters, [NotNull] Type filterType) { return AddService(filters, filterType, order: 0); } /// - /// Adds a type representing an to a filter collection. + /// Adds a type representing an to a filter collection. /// - /// A collection of . - /// Type representing an . + /// A collection of . + /// Type representing an . /// The order of the added filter. - /// An representing the added service type. + /// An representing the added service type. /// /// Filter instances will created through dependency injection. Use - /// to register a service that will be created via + /// to register a service that will be created via /// type activation. /// - public static IFilter AddService( - [NotNull] this ICollection filters, + public static IFilterMetadata AddService( + [NotNull] this ICollection filters, [NotNull] Type filterType, int order) { - if (!typeof(IFilter).GetTypeInfo().IsAssignableFrom(filterType.GetTypeInfo())) + if (!typeof(IFilterMetadata).GetTypeInfo().IsAssignableFrom(filterType.GetTypeInfo())) { - var message = Resources.FormatTypeMustDeriveFromType(filterType.FullName, typeof(IFilter).FullName); + var message = Resources.FormatTypeMustDeriveFromType(filterType.FullName, typeof(IFilterMetadata).FullName); throw new ArgumentException(message, nameof(filterType)); } diff --git a/src/Microsoft.AspNet.Mvc.Core/MvcOptions.cs b/src/Microsoft.AspNet.Mvc.Core/MvcOptions.cs index 50544ee488..161c868178 100644 --- a/src/Microsoft.AspNet.Mvc.Core/MvcOptions.cs +++ b/src/Microsoft.AspNet.Mvc.Core/MvcOptions.cs @@ -20,7 +20,7 @@ namespace Microsoft.AspNet.Mvc public MvcOptions() { Conventions = new List(); - Filters = new List(); + Filters = new List(); InputFormatters = new List(); OutputFormatters = new List(); ModelBinders = new List(); @@ -31,10 +31,10 @@ namespace Microsoft.AspNet.Mvc } /// - /// Gets a list of which are used to construct filters that + /// Gets a list of which are used to construct filters that /// apply to all actions. /// - public ICollection Filters { get; } + public ICollection Filters { get; } /// /// Gets a list of s that are used by this application. diff --git a/src/Microsoft.AspNet.Mvc.Core/ServiceFilterAttribute.cs b/src/Microsoft.AspNet.Mvc.Core/ServiceFilterAttribute.cs index c8c512b895..ff30446671 100644 --- a/src/Microsoft.AspNet.Mvc.Core/ServiceFilterAttribute.cs +++ b/src/Microsoft.AspNet.Mvc.Core/ServiceFilterAttribute.cs @@ -22,16 +22,16 @@ namespace Microsoft.AspNet.Mvc public int Order { get; set; } - public IFilter CreateInstance([NotNull] IServiceProvider serviceProvider) + public IFilterMetadata CreateInstance([NotNull] IServiceProvider serviceProvider) { var service = serviceProvider.GetRequiredService(ServiceType); - var filter = service as IFilter; + var filter = service as IFilterMetadata; if (filter == null) { throw new InvalidOperationException(Resources.FormatFilterFactoryAttribute_TypeMustImplementIFilter( typeof(ServiceFilterAttribute).Name, - typeof(IFilter).Name)); + typeof(IFilterMetadata).Name)); } return filter; diff --git a/src/Microsoft.AspNet.Mvc.Core/TypeFilterAttribute.cs b/src/Microsoft.AspNet.Mvc.Core/TypeFilterAttribute.cs index 7ab454fa91..10dd538e01 100644 --- a/src/Microsoft.AspNet.Mvc.Core/TypeFilterAttribute.cs +++ b/src/Microsoft.AspNet.Mvc.Core/TypeFilterAttribute.cs @@ -26,7 +26,7 @@ namespace Microsoft.AspNet.Mvc public int Order { get; set; } - public IFilter CreateInstance([NotNull] IServiceProvider serviceProvider) + public IFilterMetadata CreateInstance([NotNull] IServiceProvider serviceProvider) { if (_factory == null) { @@ -35,7 +35,7 @@ namespace Microsoft.AspNet.Mvc _factory = ActivatorUtilities.CreateFactory(ImplementationType, argumentTypes ?? Type.EmptyTypes); } - return (IFilter)_factory(serviceProvider, Arguments); + return (IFilterMetadata)_factory(serviceProvider, Arguments); } } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Authorization/IAllowAnonymous.cs b/src/Microsoft.AspNet.Mvc.Extensions/Authorization/IAllowAnonymous.cs index 4be7eaa3ba..2f67fec442 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Authorization/IAllowAnonymous.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Authorization/IAllowAnonymous.cs @@ -3,7 +3,7 @@ namespace Microsoft.AspNet.Mvc { - public interface IAllowAnonymous : IFilter + public interface IAllowAnonymous : IFilterMetadata { } } diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Cors/CorsAuthorizationFilter.cs b/src/Microsoft.AspNet.Mvc.Extensions/Cors/CorsAuthorizationFilter.cs index ee98baf669..5ba3c6a187 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Cors/CorsAuthorizationFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Cors/CorsAuthorizationFilter.cs @@ -82,7 +82,7 @@ namespace Microsoft.AspNet.Mvc } } - private bool IsClosestToAction(IEnumerable filters) + private bool IsClosestToAction(IEnumerable filters) { // If there are multiple ICorsAuthorizationFilter which are defined at the class and // at the action level, the one closest to the action overrides the others. diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Cors/CorsAuthorizationFilterFactory.cs b/src/Microsoft.AspNet.Mvc.Extensions/Cors/CorsAuthorizationFilterFactory.cs index cf44ac20ed..367ef8d797 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Cors/CorsAuthorizationFilterFactory.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Cors/CorsAuthorizationFilterFactory.cs @@ -32,7 +32,7 @@ namespace Microsoft.AspNet.Mvc } } - public IFilter CreateInstance([NotNull] IServiceProvider serviceProvider) + public IFilterMetadata CreateInstance([NotNull] IServiceProvider serviceProvider) { var filter = serviceProvider.GetRequiredService(); filter.PolicyName = _policyName; diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Filters/FormatFilterAttribute.cs b/src/Microsoft.AspNet.Mvc.Extensions/Filters/FormatFilterAttribute.cs index e0b10a4c1d..04216921df 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Filters/FormatFilterAttribute.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Filters/FormatFilterAttribute.cs @@ -19,7 +19,7 @@ namespace Microsoft.AspNet.Mvc /// /// The . /// An instance of . - public IFilter CreateInstance([NotNull] IServiceProvider serviceProvider) + public IFilterMetadata CreateInstance([NotNull] IServiceProvider serviceProvider) { return serviceProvider.GetRequiredService(); } diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Filters/IFormatFilter.cs b/src/Microsoft.AspNet.Mvc.Extensions/Filters/IFormatFilter.cs index 24b790c156..43d817d346 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Filters/IFormatFilter.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Filters/IFormatFilter.cs @@ -8,7 +8,7 @@ namespace Microsoft.AspNet.Mvc /// /// A filter which produces a desired content type for the current request. /// - public interface IFormatFilter : IFilter + public interface IFormatFilter : IFilterMetadata { /// /// format value in the current request. null if format not present in the current request. diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Filters/ResponseCacheAttribute.cs b/src/Microsoft.AspNet.Mvc.Extensions/Filters/ResponseCacheAttribute.cs index c0b5cf4ef0..cd090b109c 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Filters/ResponseCacheAttribute.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Filters/ResponseCacheAttribute.cs @@ -86,7 +86,7 @@ namespace Microsoft.AspNet.Mvc /// public int Order { get; set; } - public IFilter CreateInstance([NotNull] IServiceProvider serviceProvider) + public IFilterMetadata CreateInstance([NotNull] IServiceProvider serviceProvider) { var optionsAccessor = serviceProvider.GetRequiredService>(); diff --git a/src/Microsoft.AspNet.Mvc.Extensions/Filters/ValidateAntiForgeryTokenAttribute.cs b/src/Microsoft.AspNet.Mvc.Extensions/Filters/ValidateAntiForgeryTokenAttribute.cs index 7cb49b4947..efb4eb8de9 100644 --- a/src/Microsoft.AspNet.Mvc.Extensions/Filters/ValidateAntiForgeryTokenAttribute.cs +++ b/src/Microsoft.AspNet.Mvc.Extensions/Filters/ValidateAntiForgeryTokenAttribute.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNet.Mvc { public int Order { get; set; } - public IFilter CreateInstance(IServiceProvider serviceProvider) + public IFilterMetadata CreateInstance(IServiceProvider serviceProvider) { var antiforgery = serviceProvider.GetRequiredService(); return new ValidateAntiforgeryTokenAuthorizationFilter(antiforgery); diff --git a/test/Microsoft.AspNet.Mvc.ApiExplorer.Test/DefaultApiDescriptionProviderTest.cs b/test/Microsoft.AspNet.Mvc.ApiExplorer.Test/DefaultApiDescriptionProviderTest.cs index 4a915c387f..262d4038e3 100644 --- a/test/Microsoft.AspNet.Mvc.ApiExplorer.Test/DefaultApiDescriptionProviderTest.cs +++ b/test/Microsoft.AspNet.Mvc.ApiExplorer.Test/DefaultApiDescriptionProviderTest.cs @@ -1377,7 +1377,7 @@ namespace Microsoft.AspNet.Mvc.Description } } - private class ContentTypeAttribute : Attribute, IFilter, IApiResponseMetadataProvider + private class ContentTypeAttribute : Attribute, IFilterMetadata, IApiResponseMetadataProvider { public ContentTypeAttribute(string mediaType) { diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/ApplicationModel/ActionModelTest.cs b/test/Microsoft.AspNet.Mvc.Core.Test/ApplicationModel/ActionModelTest.cs index 0f3e620ac7..1a7d515893 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/ApplicationModel/ActionModelTest.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/ApplicationModel/ActionModelTest.cs @@ -117,7 +117,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels } } - private class MyFilterAttribute : Attribute, IFilter + private class MyFilterAttribute : Attribute, IFilterMetadata { } diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/ApplicationModel/ControllerModelTest.cs b/test/Microsoft.AspNet.Mvc.Core.Test/ApplicationModel/ControllerModelTest.cs index f90ca4c81b..52a4aec663 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/ApplicationModel/ControllerModelTest.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/ApplicationModel/ControllerModelTest.cs @@ -124,7 +124,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels } } - private class MyFilterAttribute : Attribute, IFilter + private class MyFilterAttribute : Attribute, IFilterMetadata { } diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/ApplicationModel/DefaultApplicationModelProviderTest.cs b/test/Microsoft.AspNet.Mvc.Core.Test/ApplicationModel/DefaultApplicationModelProviderTest.cs index bfffb64a77..901874460f 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/ApplicationModel/DefaultApplicationModelProviderTest.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/ApplicationModel/DefaultApplicationModelProviderTest.cs @@ -1153,7 +1153,7 @@ namespace Microsoft.AspNet.Mvc.ApplicationModels } } - private class MyFilterAttribute : Attribute, IFilter + private class MyFilterAttribute : Attribute, IFilterMetadata { } diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/ControllerActionDescriptorProviderTests.cs b/test/Microsoft.AspNet.Mvc.Core.Test/ControllerActionDescriptorProviderTests.cs index 136f544ddf..0125b212de 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/ControllerActionDescriptorProviderTests.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/ControllerActionDescriptorProviderTests.cs @@ -37,7 +37,7 @@ namespace Microsoft.AspNet.Mvc.Test { // Arrange var globalFilter = new MyFilterAttribute(1); - var provider = GetProvider(typeof(FiltersController).GetTypeInfo(), new IFilter[] + var provider = GetProvider(typeof(FiltersController).GetTypeInfo(), new IFilterMetadata[] { globalFilter, }); @@ -379,7 +379,7 @@ namespace Microsoft.AspNet.Mvc.Test { // Arrange var filter = new MyFilterAttribute(1); - var provider = GetProvider(typeof(PersonController).GetTypeInfo(), new IFilter[] + var provider = GetProvider(typeof(PersonController).GetTypeInfo(), new IFilterMetadata[] { filter, }); @@ -1447,7 +1447,7 @@ namespace Microsoft.AspNet.Mvc.Test private ControllerActionDescriptorProvider GetProvider( TypeInfo controllerTypeInfo, - IEnumerable filters = null) + IEnumerable filters = null) { var options = new MockMvcOptionsAccessor(); if (filters != null) @@ -1614,7 +1614,7 @@ namespace Microsoft.AspNet.Mvc.Test } } - private class MyFilterAttribute : Attribute, IFilter + private class MyFilterAttribute : Attribute, IFilterMetadata { public MyFilterAttribute(int value) { diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/ControllerActionInvokerTest.cs b/test/Microsoft.AspNet.Mvc.Core.Test/ControllerActionInvokerTest.cs index 72a8f4acd7..9109d70116 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/ControllerActionInvokerTest.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/ControllerActionInvokerTest.cs @@ -61,7 +61,7 @@ namespace Microsoft.AspNet.Mvc var tempData = new Mock(); tempData.Setup(t => t.Save()).Verifiable(); - var invoker = CreateInvoker(Mock.Of(), actionThrows: false, tempData: tempData.Object); + var invoker = CreateInvoker(Mock.Of(), actionThrows: false, tempData: tempData.Object); // Act await invoker.InvokeAsync(); @@ -77,7 +77,7 @@ namespace Microsoft.AspNet.Mvc var tempData = new Mock(); tempData.Setup(t => t.Save()).Verifiable(); - var invoker = CreateInvoker(Mock.Of(), actionThrows: true, tempData: tempData.Object); + var invoker = CreateInvoker(Mock.Of(), actionThrows: true, tempData: tempData.Object); // Act & Assert await Assert.ThrowsAsync(_actionException.GetType(), async () => await invoker.InvokeAsync()); @@ -216,7 +216,7 @@ namespace Microsoft.AspNet.Mvc .Returns((context) => Task.FromResult(true)) .Verifiable(); - var invoker = CreateInvoker(new IFilter[] { filter1.Object, filter2.Object }, actionThrows: true); + var invoker = CreateInvoker(new IFilterMetadata[] { filter1.Object, filter2.Object }, actionThrows: true); // Act await invoker.InvokeAsync(); @@ -263,7 +263,7 @@ namespace Microsoft.AspNet.Mvc var resultFilter = new Mock(MockBehavior.Strict); - var invoker = CreateInvoker(new IFilter[] { filter.Object, resultFilter.Object }, actionThrows: true); + var invoker = CreateInvoker(new IFilterMetadata[] { filter.Object, resultFilter.Object }, actionThrows: true); // Act await invoker.InvokeAsync(); @@ -352,7 +352,7 @@ namespace Microsoft.AspNet.Mvc var filter2 = new Mock(MockBehavior.Strict); - var invoker = CreateInvoker(new IFilter[] { filter1.Object, filter2.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { filter1.Object, filter2.Object }); // Act await invoker.InvokeAsync(); @@ -393,7 +393,7 @@ namespace Microsoft.AspNet.Mvc var actionFilter = new Mock(MockBehavior.Strict); var resultFilter = new Mock(MockBehavior.Strict); - var invoker = CreateInvoker(new IFilter[] + var invoker = CreateInvoker(new IFilterMetadata[] { exceptionFilter.Object, authorizationFilter1.Object, @@ -430,7 +430,7 @@ namespace Microsoft.AspNet.Mvc var resultFilter = new Mock(MockBehavior.Strict); - var invoker = CreateInvoker(new IFilter[] { authorizationFilter.Object, resultFilter.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { authorizationFilter.Object, resultFilter.Object }); // Act await invoker.InvokeAsync(); @@ -521,7 +521,7 @@ namespace Microsoft.AspNet.Mvc resultFilter.Setup(f => f.OnResultExecuting(It.IsAny())).Verifiable(); resultFilter.Setup(f => f.OnResultExecuted(It.IsAny())).Verifiable(); - var invoker = CreateInvoker(new IFilter[] + var invoker = CreateInvoker(new IFilterMetadata[] { actionFilter1.Object, actionFilter2.Object, @@ -577,7 +577,7 @@ namespace Microsoft.AspNet.Mvc resultFilter.Setup(f => f.OnResultExecuting(It.IsAny())).Verifiable(); resultFilter.Setup(f => f.OnResultExecuted(It.IsAny())).Verifiable(); - var invoker = CreateInvoker(new IFilter[] + var invoker = CreateInvoker(new IFilterMetadata[] { actionFilter1.Object, actionFilter2.Object, @@ -632,7 +632,7 @@ namespace Microsoft.AspNet.Mvc resultFilter.Setup(f => f.OnResultExecuting(It.IsAny())).Verifiable(); resultFilter.Setup(f => f.OnResultExecuted(It.IsAny())).Verifiable(); - var invoker = CreateInvoker(new IFilter[] + var invoker = CreateInvoker(new IFilterMetadata[] { actionFilter1.Object, actionFilter2.Object, @@ -788,7 +788,7 @@ namespace Microsoft.AspNet.Mvc .Callback(c => { throw exception; }) .Verifiable(); - var invoker = CreateInvoker(new IFilter[] { filter1.Object, filter2.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { filter1.Object, filter2.Object }); // Act await invoker.InvokeAsync(); @@ -832,7 +832,7 @@ namespace Microsoft.AspNet.Mvc resultFilter.Setup(f => f.OnResultExecuting(It.IsAny())).Verifiable(); resultFilter.Setup(f => f.OnResultExecuted(It.IsAny())).Verifiable(); - var invoker = CreateInvoker(new IFilter[] { actionFilter.Object, resultFilter.Object }, actionThrows: true); + var invoker = CreateInvoker(new IFilterMetadata[] { actionFilter.Object, resultFilter.Object }, actionThrows: true); // Act await invoker.InvokeAsync(); @@ -911,7 +911,7 @@ namespace Microsoft.AspNet.Mvc var filter3 = new Mock(MockBehavior.Strict); - var invoker = CreateInvoker(new IFilter[] { filter1.Object, filter2.Object, filter3.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { filter1.Object, filter2.Object, filter3.Object }); // Act await invoker.InvokeAsync(); @@ -951,7 +951,7 @@ namespace Microsoft.AspNet.Mvc var filter3 = new Mock(MockBehavior.Strict); - var invoker = CreateInvoker(new IFilter[] { filter1.Object, filter2.Object, filter3.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { filter1.Object, filter2.Object, filter3.Object }); // Act await invoker.InvokeAsync(); @@ -993,7 +993,7 @@ namespace Microsoft.AspNet.Mvc var filter3 = new Mock(MockBehavior.Strict); - var invoker = CreateInvoker(new IFilter[] { filter1.Object, filter2.Object, filter3.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { filter1.Object, filter2.Object, filter3.Object }); // Act await invoker.InvokeAsync(); @@ -1187,7 +1187,7 @@ namespace Microsoft.AspNet.Mvc var resultFilter3 = new Mock(MockBehavior.Strict); - var invoker = CreateInvoker(new IFilter[] { resultFilter1.Object, resultFilter2.Object, resultFilter3.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { resultFilter1.Object, resultFilter2.Object, resultFilter3.Object }); // Act await invoker.InvokeAsync(); @@ -1229,7 +1229,7 @@ namespace Microsoft.AspNet.Mvc var resultFilter3 = new Mock(MockBehavior.Strict); - var invoker = CreateInvoker(new IFilter[] { resultFilter1.Object, resultFilter2.Object, resultFilter3.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { resultFilter1.Object, resultFilter2.Object, resultFilter3.Object }); // Act await invoker.InvokeAsync(); @@ -1257,7 +1257,7 @@ namespace Microsoft.AspNet.Mvc }) .Verifiable(); - var invoker = CreateInvoker(new IFilter[] { resourceFilter.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter.Object }); // Act await invoker.InvokeAsync(); @@ -1346,7 +1346,7 @@ namespace Microsoft.AspNet.Mvc c.Result = expected; }); - var invoker = CreateInvoker(new IFilter[] { resourceFilter.Object, actionFilter.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter.Object, actionFilter.Object }); // Act await invoker.InvokeAsync(); @@ -1383,7 +1383,7 @@ namespace Microsoft.AspNet.Mvc c.Result = expected; }); - var invoker = CreateInvoker(new IFilter[] { resourceFilter.Object, exceptionFilter.Object }, actionThrows: true); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter.Object, exceptionFilter.Object }, actionThrows: true); // Act await invoker.InvokeAsync(); @@ -1422,7 +1422,7 @@ namespace Microsoft.AspNet.Mvc c.Result = expected; }); - var invoker = CreateInvoker(new IFilter[] { resourceFilter.Object, resultFilter.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter.Object, resultFilter.Object }); // Act await invoker.InvokeAsync(); @@ -1450,7 +1450,7 @@ namespace Microsoft.AspNet.Mvc }) .Verifiable(); - var invoker = CreateInvoker(new IFilter[] { resourceFilter.Object }, actionThrows: true); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter.Object }, actionThrows: true); // Act await invoker.InvokeAsync(); @@ -1489,7 +1489,7 @@ namespace Microsoft.AspNet.Mvc throw expected; }); - var invoker = CreateInvoker(new IFilter[] { resourceFilter.Object, actionFilter.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter.Object, actionFilter.Object }); // Act await invoker.InvokeAsync(); @@ -1528,7 +1528,7 @@ namespace Microsoft.AspNet.Mvc throw expected; }); - var invoker = CreateInvoker(new IFilter[] { resourceFilter.Object, exceptionFilter.Object }, actionThrows: true); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter.Object, exceptionFilter.Object }, actionThrows: true); // Act await invoker.InvokeAsync(); @@ -1567,7 +1567,7 @@ namespace Microsoft.AspNet.Mvc throw expected; }); - var invoker = CreateInvoker(new IFilter[] { resourceFilter.Object, resultFilter.Object }); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter.Object, resultFilter.Object }); // Act await invoker.InvokeAsync(); @@ -1600,7 +1600,7 @@ namespace Microsoft.AspNet.Mvc }) .Verifiable(); - var invoker = CreateInvoker(new IFilter[] { resourceFilter.Object }, actionThrows: true); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter.Object }, actionThrows: true); // Act await invoker.InvokeAsync(); @@ -1636,7 +1636,7 @@ namespace Microsoft.AspNet.Mvc }) .Verifiable(); - var invoker = CreateInvoker(new IFilter[] { resourceFilter1.Object, resourceFilter2.Object }, actionThrows: true); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter1.Object, resourceFilter2.Object }, actionThrows: true); // Act var exception = await Assert.ThrowsAsync(invoker.InvokeAsync); @@ -1672,7 +1672,7 @@ namespace Microsoft.AspNet.Mvc }) .Verifiable(); - var invoker = CreateInvoker(new IFilter[] { resourceFilter1.Object, resourceFilter2.Object }, actionThrows: true); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter1.Object, resourceFilter2.Object }, actionThrows: true); // Act var exception = await Assert.ThrowsAsync(invoker.InvokeAsync); @@ -1708,7 +1708,7 @@ namespace Microsoft.AspNet.Mvc }) .Verifiable(); - var invoker = CreateInvoker(new IFilter[] { resourceFilter1.Object, resourceFilter2.Object }, actionThrows: true); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter1.Object, resourceFilter2.Object }, actionThrows: true); // Act var exception = await Assert.ThrowsAsync(invoker.InvokeAsync); @@ -1755,7 +1755,7 @@ namespace Microsoft.AspNet.Mvc var resultFilter = new Mock(MockBehavior.Strict); var invoker = CreateInvoker( - new IFilter[] + new IFilterMetadata[] { resourceFilter1.Object, // This filter should see the result retured from resourceFilter2 resourceFilter2.Object, // This filter will short circuit @@ -1808,7 +1808,7 @@ namespace Microsoft.AspNet.Mvc var resultFilter = new Mock(MockBehavior.Strict); var invoker = CreateInvoker( - new IFilter[] + new IFilterMetadata[] { resourceFilter1.Object, // This filter should see the result retured from resourceFilter2 resourceFilter2.Object, @@ -1848,7 +1848,7 @@ namespace Microsoft.AspNet.Mvc context = await next(); }); - var invoker = CreateInvoker(new IFilter[] { resourceFilter.Object, }); + var invoker = CreateInvoker(new IFilterMetadata[] { resourceFilter.Object, }); // Act var exception = await Assert.ThrowsAsync(invoker.InvokeAsync); @@ -1878,7 +1878,7 @@ namespace Microsoft.AspNet.Mvc c.Result = _result; }); - var invoker = CreateInvoker(new IFilter[] { authorizationFilter.Object, resourceFilter.Object, }); + var invoker = CreateInvoker(new IFilterMetadata[] { authorizationFilter.Object, resourceFilter.Object, }); // Act await invoker.InvokeAsync(); @@ -1976,7 +1976,7 @@ namespace Microsoft.AspNet.Mvc } private TestControllerActionInvoker CreateInvoker( - IFilter filter, + IFilterMetadata filter, bool actionThrows = false, ITempDataDictionary tempData = null, int maxAllowedErrorsInModelState = 200) @@ -1985,7 +1985,7 @@ namespace Microsoft.AspNet.Mvc } private TestControllerActionInvoker CreateInvoker( - IFilter[] filters, + IFilterMetadata[] filters, bool actionThrows = false, ITempDataDictionary tempData = null, int maxAllowedErrorsInModelState = 200) diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/DefaultFilterProviderTest.cs b/test/Microsoft.AspNet.Mvc.Core.Test/DefaultFilterProviderTest.cs index 66fff9b790..91152b5ec1 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/DefaultFilterProviderTest.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/DefaultFilterProviderTest.cs @@ -18,7 +18,7 @@ namespace Microsoft.AspNet.Mvc.Filters public void DefaultFilterProvider_UsesFilter_WhenItsNotIFilterFactory() { // Arrange - var filter = Mock.Of(); + var filter = Mock.Of(); var context = CreateFilterContext(new List() { @@ -44,7 +44,7 @@ namespace Microsoft.AspNet.Mvc.Filters public void DefaultFilterProvider_UsesFilterFactory() { // Arrange - var filter = Mock.Of(); + var filter = Mock.Of(); var filterFactory = new Mock(); filterFactory @@ -75,7 +75,7 @@ namespace Microsoft.AspNet.Mvc.Filters public void DefaultFilterProvider_UsesFilterFactory_WithOrder() { // Arrange - var filter = Mock.Of(); + var filter = Mock.Of(); var filterFactory = new Mock(); filterFactory @@ -113,7 +113,7 @@ namespace Microsoft.AspNet.Mvc.Filters var filterFactory = new Mock(); filterFactory .Setup(ff => ff.CreateInstance(It.IsAny())) - .Returns(filter.As().Object); + .Returns(filter.As().Object); var context = CreateFilterContext(new List() { diff --git a/test/Microsoft.AspNet.Mvc.Core.Test/FilterCollectionExtensionsTest.cs b/test/Microsoft.AspNet.Mvc.Core.Test/FilterCollectionExtensionsTest.cs index 5024fd8b97..3405f91b33 100644 --- a/test/Microsoft.AspNet.Mvc.Core.Test/FilterCollectionExtensionsTest.cs +++ b/test/Microsoft.AspNet.Mvc.Core.Test/FilterCollectionExtensionsTest.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Mvc public void Add_UsesTypeFilterAttribute() { // Arrange - var collection = new Collection(); + var collection = new Collection(); // Act var added = collection.Add(typeof(MyFilter)); @@ -28,7 +28,7 @@ namespace Microsoft.AspNet.Mvc public void Add_WithOrder_SetsOrder() { // Arrange - var collection = new Collection(); + var collection = new Collection(); // Act var added = collection.Add(typeof(MyFilter), 17); @@ -41,11 +41,11 @@ namespace Microsoft.AspNet.Mvc public void Add_ThrowsOnNonIFilter() { // Arrange - var collection = new Collection(); + var collection = new Collection(); var expectedMessage = "The type 'Microsoft.AspNet.Mvc.FilterCollectionExtensionsTest+NonFilter' must derive from " + - "'Microsoft.AspNet.Mvc.IFilter'." + Environment.NewLine + + $"'{typeof(IFilterMetadata).FullName}'." + Environment.NewLine + "Parameter name: filterType"; // Act & Assert @@ -59,7 +59,7 @@ namespace Microsoft.AspNet.Mvc public void AddService_UsesServiceFilterAttribute() { // Arrange - var collection = new Collection(); + var collection = new Collection(); // Act var added = collection.AddService(typeof(MyFilter)); @@ -74,7 +74,7 @@ namespace Microsoft.AspNet.Mvc public void AddService_SetsOrder() { // Arrange - var collection = new Collection(); + var collection = new Collection(); // Act var added = collection.AddService(typeof(MyFilter), 17); @@ -87,11 +87,11 @@ namespace Microsoft.AspNet.Mvc public void AddService_ThrowsOnNonIFilter() { // Arrange - var collection = new Collection(); + var collection = new Collection(); var expectedMessage = "The type 'Microsoft.AspNet.Mvc.FilterCollectionExtensionsTest+NonFilter' must derive from " + - "'Microsoft.AspNet.Mvc.IFilter'." + Environment.NewLine + + $"'{typeof(IFilterMetadata).FullName}'." + Environment.NewLine + "Parameter name: filterType"; // Act & Assert @@ -101,7 +101,7 @@ namespace Microsoft.AspNet.Mvc Assert.Equal(expectedMessage, ex.Message); } - private class MyFilter : IFilter, IOrderedFilter + private class MyFilter : IFilterMetadata, IOrderedFilter { public int Order { diff --git a/test/Microsoft.AspNet.Mvc.Extensions.Test/ActionFilterAttributeTests.cs b/test/Microsoft.AspNet.Mvc.Extensions.Test/ActionFilterAttributeTests.cs index 56f3f445b9..e4f9fed123 100644 --- a/test/Microsoft.AspNet.Mvc.Extensions.Test/ActionFilterAttributeTests.cs +++ b/test/Microsoft.AspNet.Mvc.Extensions.Test/ActionFilterAttributeTests.cs @@ -43,7 +43,7 @@ namespace Microsoft.AspNet.Mvc.Test .Setup(f => f.OnActionExecuted(It.IsAny())) .Verifiable(); - var context = CreateActionExecutingContext(mock.As().Object); + var context = CreateActionExecutingContext(mock.As().Object); var next = new ActionExecutionDelegate(() => Task.FromResult(CreateActionExecutedContext(context))); // Act @@ -81,7 +81,7 @@ namespace Microsoft.AspNet.Mvc.Test .Setup(f => f.OnActionExecuted(It.IsAny())) .Verifiable(); - var context = CreateActionExecutingContext(mock.As().Object); + var context = CreateActionExecutingContext(mock.As().Object); var next = new ActionExecutionDelegate(() => { throw null; }); // This won't run // Act @@ -130,7 +130,7 @@ namespace Microsoft.AspNet.Mvc.Test .Setup(f => f.OnResultExecuted(It.IsAny())) .Verifiable(); - var context = CreateResultExecutingContext(mock.As().Object); + var context = CreateResultExecutingContext(mock.As().Object); var next = new ResultExecutionDelegate(() => Task.FromResult(CreateResultExecutedContext(context))); // Act @@ -168,7 +168,7 @@ namespace Microsoft.AspNet.Mvc.Test .Setup(f => f.OnResultExecuted(It.IsAny())) .Verifiable(); - var context = CreateResultExecutingContext(mock.As().Object); + var context = CreateResultExecutingContext(mock.As().Object); var next = new ResultExecutionDelegate(() => Task.FromResult(CreateResultExecutedContext(context))); // Act @@ -206,7 +206,7 @@ namespace Microsoft.AspNet.Mvc.Test .Setup(f => f.OnResultExecuted(It.IsAny())) .Verifiable(); - var context = CreateResultExecutingContext(mock.As().Object); + var context = CreateResultExecutingContext(mock.As().Object); var next = new ResultExecutionDelegate(() => { throw null; }); // This won't run // Act @@ -222,11 +222,11 @@ namespace Microsoft.AspNet.Mvc.Test .Verify(f => f.OnResultExecuted(It.IsAny()), Times.Never()); } - private static ActionExecutingContext CreateActionExecutingContext(IFilter filter) + private static ActionExecutingContext CreateActionExecutingContext(IFilterMetadata filter) { return new ActionExecutingContext( CreateActionContext(), - new IFilter[] { filter, }, + new IFilterMetadata[] { filter, }, new Dictionary(), controller: new object()); } @@ -239,11 +239,11 @@ namespace Microsoft.AspNet.Mvc.Test }; } - private static ResultExecutingContext CreateResultExecutingContext(IFilter filter) + private static ResultExecutingContext CreateResultExecutingContext(IFilterMetadata filter) { return new ResultExecutingContext( CreateActionContext(), - new IFilter[] { filter, }, + new IFilterMetadata[] { filter, }, new NoOpResult(), controller: new object()); } diff --git a/test/Microsoft.AspNet.Mvc.Extensions.Test/Authorization/AuthorizeFilterTest.cs b/test/Microsoft.AspNet.Mvc.Extensions.Test/Authorization/AuthorizeFilterTest.cs index 075e7b40f9..8c2c8246b2 100644 --- a/test/Microsoft.AspNet.Mvc.Extensions.Test/Authorization/AuthorizeFilterTest.cs +++ b/test/Microsoft.AspNet.Mvc.Extensions.Test/Authorization/AuthorizeFilterTest.cs @@ -329,7 +329,7 @@ namespace Microsoft.AspNet.Mvc.Test var authorizationContext = new AuthorizationContext( actionContext, - Enumerable.Empty().ToList() + Enumerable.Empty().ToList() ); return authorizationContext; diff --git a/test/Microsoft.AspNet.Mvc.Extensions.Test/FormatFilterTest.cs b/test/Microsoft.AspNet.Mvc.Extensions.Test/FormatFilterTest.cs index 88b0e4b4ec..cc674064a1 100644 --- a/test/Microsoft.AspNet.Mvc.Extensions.Test/FormatFilterTest.cs +++ b/test/Microsoft.AspNet.Mvc.Extensions.Test/FormatFilterTest.cs @@ -41,7 +41,7 @@ namespace Microsoft.AspNet.Mvc var mockObjects = new MockObjects(format, place); var resultExecutingContext = mockObjects.CreateResultExecutingContext(); - var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilter[] { }); + var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilterMetadata[] { }); var filter = new FormatFilter(mockObjects.IOptions, mockObjects.ScopedInstance); @@ -82,13 +82,13 @@ namespace Microsoft.AspNet.Mvc var resultExecutingContext = new ResultExecutingContext( ac, - new IFilter[] { }, + new IFilterMetadata[] { }, new ObjectResult("Hello!"), controller: new object()); var resourceExecutingContext = new ResourceExecutingContext( ac, - new IFilter[] { }); + new IFilterMetadata[] { }); var filter = new FormatFilter(mockObjects.IOptions, mockObjects.ScopedInstance); @@ -116,7 +116,7 @@ namespace Microsoft.AspNet.Mvc var mockObjects = new MockObjects(format, place); var resultExecutingContext = mockObjects.CreateResultExecutingContext(); - var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilter[] { }); + var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilterMetadata[] { }); mockObjects.MockFormatterMappingOptions.FormatterMappings.SetMediaTypeMappingForFormat( format, @@ -143,7 +143,7 @@ namespace Microsoft.AspNet.Mvc { // Arrange var mockObjects = new MockObjects(format, place); - var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilter[] { }); + var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilterMetadata[] { }); var filter = new FormatFilter(mockObjects.IOptions, mockObjects.ScopedInstance); @@ -160,7 +160,7 @@ namespace Microsoft.AspNet.Mvc { // Arrange var mockObjects = new MockObjects(); - var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilter[] { }); + var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilterMetadata[] { }); var filter = new FormatFilter(mockObjects.IOptions, mockObjects.ScopedInstance); @@ -182,7 +182,7 @@ namespace Microsoft.AspNet.Mvc // Arrange var produces = new ProducesAttribute(contentType, new string[] { "application/foo", "text/bar" }); var mockObjects = new MockObjects(format, place); - var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilter[] { produces }); + var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilterMetadata[] { produces }); var filter = new FormatFilter(mockObjects.IOptions, mockObjects.ScopedInstance); @@ -199,7 +199,7 @@ namespace Microsoft.AspNet.Mvc // Arrange var produces = new ProducesAttribute("application/xml;version=1", new string[] { }); var mockObjects = new MockObjects("xml", FormatSource.RouteData); - var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilter[] { produces }); + var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilterMetadata[] { produces }); mockObjects.MockFormatterMappingOptions.FormatterMappings.SetMediaTypeMappingForFormat( "xml", @@ -220,7 +220,7 @@ namespace Microsoft.AspNet.Mvc // Arrange var produces = new ProducesAttribute("application/xml", new string[] { }); var mockObjects = new MockObjects("xml", FormatSource.RouteData); - var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilter[] { produces }); + var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilterMetadata[] { produces }); mockObjects.MockFormatterMappingOptions.FormatterMappings.SetMediaTypeMappingForFormat( "xml", @@ -246,7 +246,7 @@ namespace Microsoft.AspNet.Mvc // Arrange var produces = new ProducesAttribute("application/xml", new string[] { "application/foo", "text/bar" }); var mockObjects = new MockObjects(format, place); - var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilter[] { produces }); + var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilterMetadata[] { produces }); mockObjects.MockFormatterMappingOptions.FormatterMappings.SetMediaTypeMappingForFormat( "xml", @@ -270,7 +270,7 @@ namespace Microsoft.AspNet.Mvc { // Arrange var mockObjects = new MockObjects(format, place); - var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilter[] { }); + var resourceExecutingContext = mockObjects.CreateResourceExecutingContext(new IFilterMetadata[] { }); var filter = new FormatFilter(mockObjects.IOptions, mockObjects.ScopedInstance); // Act @@ -335,7 +335,7 @@ namespace Microsoft.AspNet.Mvc Initialize(httpContext, format, place); } - public ResourceExecutingContext CreateResourceExecutingContext(IFilter[] filters) + public ResourceExecutingContext CreateResourceExecutingContext(IFilterMetadata[] filters) { var context = new ResourceExecutingContext( MockActionContext, @@ -347,7 +347,7 @@ namespace Microsoft.AspNet.Mvc { return new ResultExecutingContext( MockActionContext, - new IFilter[] { }, + new IFilterMetadata[] { }, new ObjectResult("Some Value"), controller: new object()); } diff --git a/test/Microsoft.AspNet.Mvc.Extensions.Test/ProducesAttributeTests.cs b/test/Microsoft.AspNet.Mvc.Extensions.Test/ProducesAttributeTests.cs index f9fd34e2c5..0f7c3b5aa1 100644 --- a/test/Microsoft.AspNet.Mvc.Extensions.Test/ProducesAttributeTests.cs +++ b/test/Microsoft.AspNet.Mvc.Extensions.Test/ProducesAttributeTests.cs @@ -23,7 +23,7 @@ namespace Microsoft.AspNet.Mvc.Test var mediaType1 = MediaTypeHeaderValue.Parse("application/json"); var mediaType2 = MediaTypeHeaderValue.Parse("text/json;charset=utf-8"); var producesContentAttribute = new ProducesAttribute("application/json", "text/json;charset=utf-8"); - var resultExecutingContext = CreateResultExecutingContext(new IFilter[] { producesContentAttribute }); + var resultExecutingContext = CreateResultExecutingContext(new IFilterMetadata[] { producesContentAttribute }); var next = new ResultExecutionDelegate( () => Task.FromResult(CreateResultExecutedContext(resultExecutingContext))); @@ -47,7 +47,7 @@ namespace Microsoft.AspNet.Mvc.Test formatFilter.Setup(f => f.IsActive) .Returns(false); - var filters = new IFilter[] { producesContentAttribute, formatFilter.Object }; + var filters = new IFilterMetadata[] { producesContentAttribute, formatFilter.Object }; var resultExecutingContext = CreateResultExecutingContext(filters); var next = new ResultExecutionDelegate( @@ -71,7 +71,7 @@ namespace Microsoft.AspNet.Mvc.Test formatFilter.Setup(f => f.IsActive) .Returns(true); - var filters = new IFilter[] { producesContentAttribute, formatFilter.Object }; + var filters = new IFilterMetadata[] { producesContentAttribute, formatFilter.Object }; var resultExecutingContext = CreateResultExecutingContext(filters); var next = new ResultExecutionDelegate( @@ -169,7 +169,7 @@ namespace Microsoft.AspNet.Mvc.Test return new ResultExecutedContext(context, context.Filters, context.Result, context.Controller); } - private static ResultExecutingContext CreateResultExecutingContext(IFilter[] filters) + private static ResultExecutingContext CreateResultExecutingContext(IFilterMetadata[] filters) { return new ResultExecutingContext( CreateActionContext(), diff --git a/test/Microsoft.AspNet.Mvc.Extensions.Test/RequireHttpsAttributeTests.cs b/test/Microsoft.AspNet.Mvc.Extensions.Test/RequireHttpsAttributeTests.cs index dfe692e0a5..18acc57597 100644 --- a/test/Microsoft.AspNet.Mvc.Extensions.Test/RequireHttpsAttributeTests.cs +++ b/test/Microsoft.AspNet.Mvc.Extensions.Test/RequireHttpsAttributeTests.cs @@ -154,7 +154,7 @@ namespace Microsoft.AspNet.Mvc { var actionContext = new ActionContext(ctx, new RouteData(), actionDescriptor: null); - return new AuthorizationContext(actionContext, Enumerable.Empty().ToList()); + return new AuthorizationContext(actionContext, Enumerable.Empty().ToList()); } } } \ No newline at end of file diff --git a/test/Microsoft.AspNet.Mvc.Extensions.Test/ResponseCacheFilterTest.cs b/test/Microsoft.AspNet.Mvc.Extensions.Test/ResponseCacheFilterTest.cs index f79a6cb838..347ada991b 100644 --- a/test/Microsoft.AspNet.Mvc.Extensions.Test/ResponseCacheFilterTest.cs +++ b/test/Microsoft.AspNet.Mvc.Extensions.Test/ResponseCacheFilterTest.cs @@ -21,7 +21,7 @@ namespace Microsoft.AspNet.Mvc NoStore = true, Duration = null }); - var context = GetActionExecutingContext(new List { cache }); + var context = GetActionExecutingContext(new List { cache }); // Act cache.OnActionExecuting(context); @@ -54,7 +54,7 @@ namespace Microsoft.AspNet.Mvc Duration = null }); - var context = GetActionExecutingContext(new List { cache }); + var context = GetActionExecutingContext(new List { cache }); // Act & Assert var ex = Assert.Throws(() => cache.OnActionExecuting(context)); @@ -151,7 +151,7 @@ namespace Microsoft.AspNet.Mvc public void OnActionExecuting_CanSetCacheControlHeaders(ResponseCacheFilter cache, string output) { // Arrange - var context = GetActionExecutingContext(new List { cache }); + var context = GetActionExecutingContext(new List { cache }); // Act cache.OnActionExecuting(context); @@ -199,7 +199,7 @@ namespace Microsoft.AspNet.Mvc ResponseCacheFilter cache, string output) { // Arrange - var context = GetActionExecutingContext(new List { cache }); + var context = GetActionExecutingContext(new List { cache }); // Act cache.OnActionExecuting(context); @@ -269,7 +269,7 @@ namespace Microsoft.AspNet.Mvc public void ResponseCacheCanSetVary(ResponseCacheFilter cache, string varyOutput, string cacheControlOutput) { // Arrange - var context = GetActionExecutingContext(new List { cache }); + var context = GetActionExecutingContext(new List { cache }); // Act cache.OnActionExecuting(context); @@ -288,7 +288,7 @@ namespace Microsoft.AspNet.Mvc { Duration = 0, Location = ResponseCacheLocation.None, NoStore = true, VaryByHeader = null }); - var context = GetActionExecutingContext(new List { cache }); + var context = GetActionExecutingContext(new List { cache }); // Act cache.OnActionExecuting(context); @@ -302,7 +302,7 @@ namespace Microsoft.AspNet.Mvc public void IsOverridden_ReturnsTrueForAllButLastFilter() { // Arrange - var caches = new List(); + var caches = new List(); caches.Add(new ResponseCacheFilter( new CacheProfile { @@ -333,7 +333,7 @@ namespace Microsoft.AspNet.Mvc Duration = 10 }); cache.Duration = 20; - var context = GetActionExecutingContext(new List { cache }); + var context = GetActionExecutingContext(new List { cache }); // Act cache.OnActionExecuting(context); @@ -353,7 +353,7 @@ namespace Microsoft.AspNet.Mvc Location = ResponseCacheLocation.None }); cache.Location = ResponseCacheLocation.Client; - var context = GetActionExecutingContext(new List { cache }); + var context = GetActionExecutingContext(new List { cache }); // Act cache.OnActionExecuting(context); @@ -373,7 +373,7 @@ namespace Microsoft.AspNet.Mvc }); cache.NoStore = false; cache.Duration = 10; - var context = GetActionExecutingContext(new List { cache }); + var context = GetActionExecutingContext(new List { cache }); // Act cache.OnActionExecuting(context); @@ -393,7 +393,7 @@ namespace Microsoft.AspNet.Mvc VaryByHeader = "Accept" }); cache.VaryByHeader = "Test"; - var context = GetActionExecutingContext(new List { cache }); + var context = GetActionExecutingContext(new List { cache }); // Act cache.OnActionExecuting(context); @@ -402,11 +402,11 @@ namespace Microsoft.AspNet.Mvc Assert.Equal("Test", context.HttpContext.Response.Headers.Get("Vary")); } - private ActionExecutingContext GetActionExecutingContext(List filters = null) + private ActionExecutingContext GetActionExecutingContext(List filters = null) { return new ActionExecutingContext( new ActionContext(new DefaultHttpContext(), new RouteData(), new ActionDescriptor()), - filters ?? new List(), + filters ?? new List(), new Dictionary(), new object()); } diff --git a/test/Microsoft.AspNet.Mvc.Extensions.Test/SkipStatusCodePagesAttributeTest.cs b/test/Microsoft.AspNet.Mvc.Extensions.Test/SkipStatusCodePagesAttributeTest.cs index e4b22f44e9..91f4affa8a 100644 --- a/test/Microsoft.AspNet.Mvc.Extensions.Test/SkipStatusCodePagesAttributeTest.cs +++ b/test/Microsoft.AspNet.Mvc.Extensions.Test/SkipStatusCodePagesAttributeTest.cs @@ -15,7 +15,7 @@ namespace Microsoft.AspNet.Mvc.Core.Test { // Arrange var skipStatusCodeAttribute = new SkipStatusCodePagesAttribute(); - var resourceExecutingContext = CreateResourceExecutingContext(new IFilter[] { skipStatusCodeAttribute }); + var resourceExecutingContext = CreateResourceExecutingContext(new IFilterMetadata[] { skipStatusCodeAttribute }); var statusCodePagesFeature = new TestStatusCodeFeature(); resourceExecutingContext.HttpContext.SetFeature(statusCodePagesFeature); @@ -31,13 +31,13 @@ namespace Microsoft.AspNet.Mvc.Core.Test { // Arrange var skipStatusCodeAttribute = new SkipStatusCodePagesAttribute(); - var resourceExecutingContext = CreateResourceExecutingContext(new IFilter[] { skipStatusCodeAttribute }); + var resourceExecutingContext = CreateResourceExecutingContext(new IFilterMetadata[] { skipStatusCodeAttribute }); // Act skipStatusCodeAttribute.OnResourceExecuting(resourceExecutingContext); } - private static ResourceExecutingContext CreateResourceExecutingContext(IFilter[] filters) + private static ResourceExecutingContext CreateResourceExecutingContext(IFilterMetadata[] filters) { return new ResourceExecutingContext( CreateActionContext(), diff --git a/test/Microsoft.AspNet.Mvc.WebApiCompatShimTest/HttpResponseExceptionActionFilterTest.cs b/test/Microsoft.AspNet.Mvc.WebApiCompatShimTest/HttpResponseExceptionActionFilterTest.cs index a8e36170a8..f9333f437a 100644 --- a/test/Microsoft.AspNet.Mvc.WebApiCompatShimTest/HttpResponseExceptionActionFilterTest.cs +++ b/test/Microsoft.AspNet.Mvc.WebApiCompatShimTest/HttpResponseExceptionActionFilterTest.cs @@ -42,7 +42,7 @@ namespace Microsoft.AspNet.Mvc.WebApiCompatShim var context = new ActionExecutingContext( actionContext, - filters: new List(), + filters: new List(), actionArguments: new Dictionary(), controller: new object()); @@ -68,7 +68,7 @@ namespace Microsoft.AspNet.Mvc.WebApiCompatShim var context = new ActionExecutedContext( actionContext, - filters: new List(), + filters: new List(), controller: new object()); context.Exception = new HttpResponseException(HttpStatusCode.BadRequest);