My current stack is ASP.NET MVC 4 and Entity Framework 5.0. I installed ninject.mvc3 by NuGet and the code showed below works fine:

```
public class SessionsController : Controller
{
    // use "kernel.Bind<MyContext>().ToSelf().InRequestScope();" 
    // to inject MyContext
    private MyContext _context;

    public SessionsController(MyContext context)
    {
        _context = context;
    }

    [HttpGet]
    public ActionResult Login()
    {
        System.Diagnostics.Debug.WriteLine(_context.Users.Count());
        return View();
    }
}

```

}

Now, I want to extract a BaseController for my controllers: 

```
public class BaseController : Controller
{
    protected MyContext _context;

    public BaseController(MyContext context)
    {
        _context = context;
    }

    // I don't know what should be write here and 
    // base controller must have a parameterless constructor
    public BaseController() 
    {

    }
}

```

Then I make SessionsController inherit from BaseController. When I run the code, an exception throwed that 

> 
> "Object reference not set to an instance of an object.(with MyContext)"
> 
> 
> 

Do I use Ninject wrong?

**--UPDATED--** the ninject's NinjectWebCommon.cs's code

```
    /// <summary>
    /// Load your modules or register your services here!
    /// </summary>
    /// <param name="kernel">The kernel.</param>
    private static void RegisterServices(IKernel kernel)
    {
        kernel.Bind<TelesingContext>().ToSelf().InRequestScope();
    }        

```

**--UPDATED--** the edited SessionsController.cs code

```
public class SessionsController : BaseController
{
    [HttpGet]
    public ActionResult Login()
    {
        System.Diagnostics.Debug.WriteLine(_context.Users.Count());
        return View();
    }
}

```

}