Cleanup + TODO
This commit is contained in:
parent
f1efbde29d
commit
54c73e4227
|
|
@ -33,7 +33,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
InitializeController(controller, actionContext);
|
InitializeController(controller, actionContext);
|
||||||
|
|
||||||
return controller;
|
return controller;
|
||||||
}
|
} // TODO: Should we not catch it here?
|
||||||
catch (ReflectionTypeLoadException)
|
catch (ReflectionTypeLoadException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,13 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Mvc.Filters
|
namespace Microsoft.AspNet.Mvc.Filters
|
||||||
{
|
{
|
||||||
public class FilterPipelineBuilder<T>
|
public class FilterPipelineBuilder<TContext>
|
||||||
{
|
{
|
||||||
private readonly IFilter<T>[] _filters;
|
private readonly IFilter<TContext>[] _filters;
|
||||||
private readonly T _context;
|
private readonly TContext _context;
|
||||||
|
|
||||||
// FilterDescriptors are already ordered externally.
|
// FilterDescriptors are already ordered externally.
|
||||||
public FilterPipelineBuilder(IEnumerable<IFilter<T>> filters, T context)
|
public FilterPipelineBuilder(IEnumerable<IFilter<TContext>> filters, TContext context)
|
||||||
{
|
{
|
||||||
_filters = filters.ToArray();
|
_filters = filters.ToArray();
|
||||||
_context = context;
|
_context = context;
|
||||||
|
|
@ -26,13 +26,13 @@ namespace Microsoft.AspNet.Mvc.Filters
|
||||||
|
|
||||||
private class CallNextAsync
|
private class CallNextAsync
|
||||||
{
|
{
|
||||||
private readonly T _context;
|
private readonly TContext _context;
|
||||||
private readonly IFilter<T>[] _filters;
|
private readonly IFilter<TContext>[] _filters;
|
||||||
private readonly Func<Task> _next;
|
private readonly Func<Task> _next;
|
||||||
|
|
||||||
private int _index;
|
private int _index;
|
||||||
|
|
||||||
public CallNextAsync(T context, IFilter<T>[] filters)
|
public CallNextAsync(TContext context, IFilter<TContext>[] filters)
|
||||||
{
|
{
|
||||||
_context = context;
|
_context = context;
|
||||||
_next = CallNextProvider;
|
_next = CallNextProvider;
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.Mvc.Filters
|
namespace Microsoft.AspNet.Mvc.Filters
|
||||||
{
|
{
|
||||||
public interface IFilter<T>
|
public interface IFilter<TContext>
|
||||||
{
|
{
|
||||||
Task Invoke(T context, Func<Task> next);
|
Task Invoke(TContext context, Func<Task> next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
|
|
||||||
if (controller == null)
|
if (controller == null)
|
||||||
{
|
{
|
||||||
|
// TODO: See if these return 404s should turn into 500s
|
||||||
actionResult = new HttpStatusCodeResult(404);
|
actionResult = new HttpStatusCodeResult(404);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -62,6 +63,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
|
|
||||||
if (method == null)
|
if (method == null)
|
||||||
{
|
{
|
||||||
|
// TODO: See if these return 404s should turn into 500s
|
||||||
actionResult = new HttpStatusCodeResult(404);
|
actionResult = new HttpStatusCodeResult(404);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue