CR feedback

This commit is contained in:
Yishai Galatzer 2014-03-07 18:25:25 -08:00
parent 7ddf8a7bdb
commit 28e0792db6
5 changed files with 5 additions and 6 deletions

View File

@ -4,7 +4,7 @@ using System.Threading.Tasks;
namespace Microsoft.AspNet.Mvc.Filters
{
// This one lives in the FilterDescriptors namespace, and only intended to be consumed by folks that rewrite the action invoker.
// This one lives in the Filters namespace, and only intended to be consumed by folks that rewrite the action invoker.
public class ReflectedActionFilterEndPoint : IActionFilter
{
private readonly Func<object[], Task<object>> _coreMethodInvoker;

View File

@ -55,8 +55,7 @@ namespace Microsoft.AspNet.Mvc.Filters
if (typeFilterSignature != null)
{
// TODO: How do we pass extra parameters
var typeFilter =
ServiceProvider.GetService<TypeActivator>().CreateInstance(typeFilterSignature.ImplementationType);
var typeFilter = ActivatorUtilities.CreateInstance(ServiceProvider, typeFilterSignature.ImplementationType);
AddFilters(context, typeFilter, true);
failIfNotFilter = false;

View File

@ -4,7 +4,7 @@ namespace Microsoft.AspNet.Mvc
{
public class FilterDescriptorComparer : IComparer<FilterDescriptor>
{
private static FilterDescriptorComparer _comparer = new FilterDescriptorComparer();
private static readonly FilterDescriptorComparer _comparer = new FilterDescriptorComparer();
public static FilterDescriptorComparer Comparer { get { return _comparer; } }

View File

@ -3,7 +3,7 @@
public static class FilterOrigin
{
public static readonly int Action = 100;
public static readonly int Controlller = 200;
public static readonly int Controller = 200;
public static readonly int Global = 300;
}
}

View File

@ -51,7 +51,7 @@ namespace Microsoft.AspNet.Mvc
var controllerAttributes = cd.ControllerTypeInfo.GetCustomAttributes(inherit: true).ToArray();
var globalAndControllerFilters =
controllerAttributes.OfType<IFilter>()
.Select(filter => new FilterDescriptor(filter, FilterOrigin.Controlller))
.Select(filter => new FilterDescriptor(filter, FilterOrigin.Controller))
.Concat(_globalFilters)
.OrderBy(d => d, FilterDescriptorComparer.Comparer)
.ToArray();