IInstanceProvider.GetInstance Method (InstanceContext)
Returns a service object given the specified InstanceContext object.
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Use themethod to control the exact service object that a WCF service receives when it attempts to create a new one.
The following code example shows how to implement IInstanceProvider that provides "singleton" behavior; it always returns the same service instance and does not recycle it.
The following code example shows how to implement a custom attribute that implements IContractBehavior to insert the custom service instance provider. It also implements IContractBehaviorAttribute, which binds its use to a specific contract.
Available since 3.0