¿Alguien me podria decir qué me esta queriendo decir esta sentencia?
return controllerType != null
? _container.Resolve(controllerType) as IController
: base.GetControllerInstance(requestContext, controllerType);
Dentro del código:
using Dominio.MesaEntrada.Expedientes;
namespace MVC.Client.Extensiones.ControllerFactories
{
public class UnityControllerFactory : DefaultControllerFactory
{
private readonly IUnityContainer _container;
public UnityControllerFactory(IUnityContainer container)
{
_container = container;
}
protected override IController GetControllerInstance(System.Web.Routing.RequestContext requestContext, Type controllerType)
{
try
{
return controllerType != null
? _container.Resolve(controllerType) as IController
: base.GetControllerInstance(requestContext, controllerType);
}
catch (ResolutionFailedException)
{
//Log the exception if needed
//Try to resolve using default factory
return base.GetControllerInstance(requestContext, controllerType);
}
}
}
}