Skip to content

Commit 0fdce35

Browse files
0xcedmconnew
authored andcommitted
Make ServiceChannelProxy implement IAsyncDisposable
So that channels created through a `ChannelFactory<T>` without inheriting from `ClientBase<T>` can also benefit from the asynchronous disposal improvements introduced in #4865. Fixes #5270
1 parent 911e6f4 commit 0fdce35

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/System.ServiceModel.Primitives/src/System/ServiceModel/Channels/ServiceChannelProxy.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
namespace System.ServiceModel.Channels
1717
{
18-
public class ServiceChannelProxy : DispatchProxy, ICommunicationObject, IChannel, IClientChannel, IOutputChannel, IRequestChannel, IServiceChannel, IDuplexContextChannel
18+
public class ServiceChannelProxy : DispatchProxy, ICommunicationObject, IChannel, IClientChannel, IOutputChannel, IRequestChannel, IServiceChannel, IDuplexContextChannel, IAsyncDisposable
1919
{
2020
private const String activityIdSlotName = "E2ETrace.ActivityID";
2121
private Type _proxiedType;
@@ -673,6 +673,11 @@ void IDisposable.Dispose()
673673
((IClientChannel)_serviceChannel).Dispose();
674674
}
675675

676+
ValueTask IAsyncDisposable.DisposeAsync()
677+
{
678+
return ((IAsyncDisposable)_serviceChannel).DisposeAsync();
679+
}
680+
676681
bool IContextChannel.AllowOutputBatching
677682
{
678683
get

0 commit comments

Comments
 (0)