When the WCF method is called, it is passed to the instance service .
An instance of an instance simply refers to the moment the WCF system has this instance.
In the call forwarding service, instance deactivation will be performed after each method call.
, Close -, - .
Singleton , .
:.
[OperationBehavior(ReleaseInstanceMode = ReleaseInstanceMode.AfterCall)]
public void MyMethodWhichTriggersAnAutomaticRelease()
{
}
, :
public void MyMethodWhichTriggersAManualRelease()
{
OperationContext.Current.InstanceContext.ReleaseServiceInstance();
}
Juval Lowy , :
- , , . , .