I have a class to hold session like this
public class SessionService : ISession
{
public HttpContext Context { get; set; }
public SessionService(HttpContext context)
{
this.Context = context;
}
}
I want to be able to inject the session object in various places in my MVC3 app. I have this interface
interface ISession
{
HttpContext Context { get; set; }
}
I am using ninject to bind the session class to the interface like this
private void RegisterDependencyResolver()
{
var kernel = new StandardKernel();
kernel.Bind<ISession>().To<SessionService>();
DependencyResolver.SetResolver(new NinjectDependencyResolver(kernel));
}
My problem is how to pass the Httpcontext parameter into the SessionService constructor.
Any pointers most appreciated.
Thanks