Fix 5 param On extension method (#1984)

This commit is contained in:
Mikael Mengistu 2018-04-13 00:37:13 +00:00 committed by GitHub
parent d5a4d9b8c5
commit df4d901ae7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -78,14 +78,14 @@ namespace Microsoft.AspNetCore.SignalR.Client
args => handler((T1)args[0], (T2)args[1], (T3)args[2], (T4)args[3])); args => handler((T1)args[0], (T2)args[1], (T3)args[2], (T4)args[3]));
} }
public static void On<T1, T2, T3, T4, T5>(this HubConnection hubConnection, string methodName, Action<T1, T2, T3, T4, T5> handler) public static IDisposable On<T1, T2, T3, T4, T5>(this HubConnection hubConnection, string methodName, Action<T1, T2, T3, T4, T5> handler)
{ {
if (hubConnection == null) if (hubConnection == null)
{ {
throw new ArgumentNullException(nameof(hubConnection)); throw new ArgumentNullException(nameof(hubConnection));
} }
hubConnection.On(methodName, return hubConnection.On(methodName,
new[] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5) }, new[] { typeof(T1), typeof(T2), typeof(T3), typeof(T4), typeof(T5) },
args => handler((T1)args[0], (T2)args[1], (T3)args[2], (T4)args[3], (T5)args[4])); args => handler((T1)args[0], (T2)args[1], (T3)args[2], (T4)args[3], (T5)args[4]));
} }