diff --git a/src/csharp/Grpc.Core/Interceptors/ChannelExtensions.cs b/src/csharp/Grpc.Core.Api/Interceptors/ChannelExtensions.cs similarity index 87% rename from src/csharp/Grpc.Core/Interceptors/ChannelExtensions.cs rename to src/csharp/Grpc.Core.Api/Interceptors/ChannelExtensions.cs index c7d0c2472a1..fe3b516857e 100644 --- a/src/csharp/Grpc.Core/Interceptors/ChannelExtensions.cs +++ b/src/csharp/Grpc.Core.Api/Interceptors/ChannelExtensions.cs @@ -38,9 +38,9 @@ namespace Grpc.Core.Interceptors /// building a chain like "channel.Intercept(c).Intercept(b).Intercept(a)". Note that /// in this case, the last interceptor added will be the first to take control. /// - public static CallInvoker Intercept(this Channel channel, Interceptor interceptor) + public static CallInvoker Intercept(this ChannelBase channel, Interceptor interceptor) { - return new DefaultCallInvoker(channel).Intercept(interceptor); + return channel.CreateCallInvoker().Intercept(interceptor); } /// @@ -59,9 +59,9 @@ namespace Grpc.Core.Interceptors /// building a chain like "channel.Intercept(c).Intercept(b).Intercept(a)". Note that /// in this case, the last interceptor added will be the first to take control. /// - public static CallInvoker Intercept(this Channel channel, params Interceptor[] interceptors) + public static CallInvoker Intercept(this ChannelBase channel, params Interceptor[] interceptors) { - return new DefaultCallInvoker(channel).Intercept(interceptors); + return channel.CreateCallInvoker().Intercept(interceptors); } /// @@ -79,9 +79,9 @@ namespace Grpc.Core.Interceptors /// building a chain like "channel.Intercept(c).Intercept(b).Intercept(a)". Note that /// in this case, the last interceptor added will be the first to take control. /// - public static CallInvoker Intercept(this Channel channel, Func interceptor) + public static CallInvoker Intercept(this ChannelBase channel, Func interceptor) { - return new DefaultCallInvoker(channel).Intercept(interceptor); + return channel.CreateCallInvoker().Intercept(interceptor); } } } diff --git a/src/csharp/Grpc.Core/ForwardedTypes.cs b/src/csharp/Grpc.Core/ForwardedTypes.cs index 4394a7c907c..eaf974c3356 100644 --- a/src/csharp/Grpc.Core/ForwardedTypes.cs +++ b/src/csharp/Grpc.Core/ForwardedTypes.cs @@ -38,6 +38,7 @@ using Grpc.Core.Utils; [assembly:TypeForwardedToAttribute(typeof(CallInvoker))] [assembly:TypeForwardedToAttribute(typeof(CallInvokerExtensions))] [assembly:TypeForwardedToAttribute(typeof(CallOptions))] +[assembly:TypeForwardedToAttribute(typeof(ChannelExtensions))] [assembly:TypeForwardedToAttribute(typeof(ClientBase))] [assembly:TypeForwardedToAttribute(typeof(ClientBase<>))] [assembly:TypeForwardedToAttribute(typeof(ChannelCredentials))]