Well, Bill Pierce in his post about making the HttpContext wrapper use the application as a service provider got me to a good enough solution for the script service I had wanted in my previous post.
While not quite as clean as adding it to the HttpContext, I think an extension method on HttpApplication like this will work well for now.
public static object GetService(this HttpApplication application,Type service)
{
IServiceProvider provider = application as IServiceProvider;
if (provider == null)
return null;
return provider.GetService(service);
}
Then add/implement the IServiceProvider...
posted @ Tuesday, December 18, 2007 11:06 AM |