Search code examples
c#asp.net.netwcfhttpcontext

Generic context


I have a class that will be used in multiple types of apps: web, wcf service, windows app. In the web app I want to use HttpContext in wcf the OperationContext and in Windows... a (I don't even know maybe an IDictionary?) How can this be done so that in my class I am just accessing a generic thing to pull data out of but use the appropriate context for each type of application?


Solution

  • Use Adapter design patten.
    A C# example can be found here.

    HTH