Extension Method

There are 1 entries for the tag Extension Method

Temp service provider implementation

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...

Copyright © Sean Lynch

Design by Bartosz Brzezinski

Design by Phil Haack Based On A Design By Bartosz Brzezinski