I am self-hosting WCF services and have a special(?) requirement: I need a service instance for each channel. I need some advice on how to do this.
I have surmised that I cannot use InstanceContextMode.PerSession since I want each channel to have its own service instance, not just per session. I cannot user PerCall since I want the same instance for a given channel. Therefore, it appears that I need to use Single, but with some special handling. Does this sound correct? Or, is there a way to satisfy my requirement with a combination of InstanceContextMode, SessionMode, etc.?
After some reading, it appears that my special handling needs to be in a custom IInstanceProvider. Does this sound correct? Is there something else I need to do?
I am feeling my way around a bit and just looking for advice on whether I am on the right path. If not, please point me in another direction and I'll check it out. If so, then any helpful advice (articles, examples) is most welcome.