[Fixes #2095] Mark IControllerFactory methods in DefaultControllerFactory as virtual
This commit is contained in:
parent
7d1c1ed8eb
commit
9a44e3e08b
|
|
@ -23,7 +23,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
_typeActivatorCache = typeActivatorCache;
|
_typeActivatorCache = typeActivatorCache;
|
||||||
}
|
}
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public object Create([NotNull] ActionContext actionContext, [NotNull] Type controllerType)
|
public virtual object Create([NotNull] ActionContext actionContext, [NotNull] Type controllerType)
|
||||||
{
|
{
|
||||||
var serviceProvider = actionContext.HttpContext.RequestServices;
|
var serviceProvider = actionContext.HttpContext.RequestServices;
|
||||||
return _typeActivatorCache.CreateInstance<object>(serviceProvider, controllerType);
|
return _typeActivatorCache.CreateInstance<object>(serviceProvider, controllerType);
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,19 @@ namespace Microsoft.AspNet.Mvc
|
||||||
_getPropertiesToActivate = GetPropertiesToActivate;
|
_getPropertiesToActivate = GetPropertiesToActivate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The <see cref="IControllerActivator"/> used to create a controller.
|
||||||
|
/// </summary>
|
||||||
|
protected IControllerActivator ControllerActivator
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _controllerActivator;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public object CreateController([NotNull] ActionContext actionContext)
|
public virtual object CreateController([NotNull] ActionContext actionContext)
|
||||||
{
|
{
|
||||||
var actionDescriptor = actionContext.ActionDescriptor as ControllerActionDescriptor;
|
var actionDescriptor = actionContext.ActionDescriptor as ControllerActionDescriptor;
|
||||||
if (actionDescriptor == null)
|
if (actionDescriptor == null)
|
||||||
|
|
@ -58,7 +69,7 @@ namespace Microsoft.AspNet.Mvc
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public void ReleaseController(object controller)
|
public virtual void ReleaseController(object controller)
|
||||||
{
|
{
|
||||||
var disposableController = controller as IDisposable;
|
var disposableController = controller as IDisposable;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue