override GetControllerInstance in MVC

Posted by loviji on Stack Overflow See other posts from Stack Overflow or by loviji
Published on 2010-04-09T23:37:39Z Indexed on 2010/04/09 23:43 UTC
Read the original article Hit count: 472

Filed under:
|

I have a code in asp.net MVC v.1:

protected override IController GetControllerInstance(HttpContext null , Type controllerType)
    {
        string connectionString = ConfigurationManager.ConnectionStrings["someEntities"].ConnectionString;
        return Activator.CreateInstance(controllerType, new DataManager(connectionString)) as IController;            
    }

now I use asp.net mvc v.2. And I know that, now GetController implemented as

public virtual IController CreateController(RequestContext requestContext, string controllerName);

How can return old functionality of upper code?

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2

Related posts about asp.net-mvc