I am new in Ninject and I need some help to move on.
I have a solution that consists of web.form (presentation) and various other class libraries projects.
In web.form application inside NinjectWebCommon cs file I have the following
kernel.Bind<HttpContext>()
.ToMethod(ctx => HttpContext.Current).InThreadScope();
kernel.Bind<HttpContextBase>()
.ToMethod(ctx => new HttpContextWrapper(HttpContext.Current)).InTransientScope();
kernel.Bind<MPIBE.DESTINATION.CORE.SiteContext>()
.ToMethod(ctx => new MPIBE.DESTINATION.CORE.SiteContext(
new HttpContextWrapper(HttpContext.Current)
));
I am trying to get an instance of a class (following the constructor)
public SessionUtilities(SiteContext siteContext)
{
_siteContext = siteContext;
}
and I noticed that i can get the instance only form web.forms application and I can't get from other projects (class libraries). Does this make any sense?
I am trying to get the instance via property injection
[Inject]
public SessionUtilities _sessionUtilities { get; set; }