I have a largish project that I am working to make more palatable for testing AND eventual conversion to core. I converted a static class that wrapped session state to be non-static and I have all my controllers that use it injected now. However, I have my layout.cshtml and a few other layout files that are switched in/out based on the user.
Without resorting to converting everything in these layouts to direct session state access ((bool)Session["SessionVarName"]) is there a way in these views to inject the non-static class now so I can still use my wrapper for access instead (session.SessionVarName)?
Something like this at the top of my layout views:
@{
ISessionWrapper session;
var session = StructureMap.Container....GetInstanceOf(...)
}
or perhaps somewhere in the plumbing that I tell MVC that layout has this dependency?