OperationContext.OperationCompleted Event
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the operation has completed.
public:
event EventHandler ^ OperationCompleted;
public event EventHandler OperationCompleted;
member this.OperationCompleted : EventHandler
Public Custom Event OperationCompleted As EventHandler
Public Event OperationCompleted As EventHandler
Use the OperationCompleted event to dispose parameters or a return value if you set OperationBehaviorAttribute.AutoDisposeParameters to false
. Normally you set OperationBehaviorAttribute.AutoDisposeParameters to false
to prevent WCF from calling IDisposable.Dispose on the parameter and return value objects. However, if some parameters need to be preserved while others need to be disposed, this event is the best place to dispose those parameters.
Also, with duplex bindings, this event can be used to send a request on the callback channel after the reply for the current operation is sent.
Notă
If a caller is listening for the OperationContext.OperationCompleted event for an OperationContractAttribute.IsTerminating operation, it is possible to block when the response is received. The proper way to handle this is to schedule work on another thread when OperationCompleted is raised and then immediately return from that event handler.
Produs | Versiuni |
---|---|
.NET | Core 1.0, Core 1.1, 8 (package-provided) |
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1 |
.NET Standard | 2.0 (package-provided) |
UWP | 10.0 |
Feedback pentru .NET
.NET este un proiect open source. Selectați un link pentru a oferi feedback: