I want to use Session_Start to do some logic as to who the user is. In order to do this, need to resolve dependency to a repository from session_start…how do I do that? I need to be able to set some properties of CustomUserSession (AuthUserSession) and save.
Or is there a better pattern to handle things like this?
Note the Session_Start in Global.asax is only for ASP.NET Session Provider model, this is completely independent and decoupled implementation from ServiceStack’s Sessions.
Have a look at the OnAuthenticated Session and Auth Events. You can resolve dependencies using TryResolve<T> from an injected IServiceBase or anywhere using the singleton HostContext.TryResolve<T>().