views:

56

answers:

1

I am implementing an HTTP Module in ASP.NET to identify geographical information based on the request's IP (a GeoIP module) and I will need to place things somewhere so the handler or later modules can inspect.

Except HttpContext.Items (which is not type-safe) is there some other decent alternative?

+2  A: 

It depends what you want to store. Type safety can only really apply if you are using one type of item within a collection so none of the generic stores will be applicable for you.

Maybe it would be a better idea to implement a helper class to write and read from a subset of HttpContext.Current.Items in a type safe manner?

Tim
Agreed, just add a class that reads from and writes to HttpContext in a type-safe manner. It's the easiest way to do it.
Deeksy