Skip to content

Commit ec21fba

Browse files
committed
Add public API baselines to SignalR
1 parent 035221d commit ec21fba

32 files changed

+849
-0
lines changed

src/SignalR/clients/csharp/Client.Core/src/HubConnectionExtensions.InvokeAsync.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Diagnostics.CodeAnalysis;
56
using System.Threading;
67
using System.Threading.Tasks;
78

@@ -19,6 +20,7 @@ public partial class HubConnectionExtensions
1920
/// <param name="methodName">The name of the server method to invoke.</param>
2021
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None" />.</param>
2122
/// <returns>A <see cref="Task{TResult}"/> that represents the asynchronous invoke.</returns>
23+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
2224
public static Task InvokeAsync(this HubConnection hubConnection, string methodName, CancellationToken cancellationToken = default)
2325
{
2426
return hubConnection.InvokeCoreAsync(methodName, Array.Empty<object>(), cancellationToken);
@@ -32,6 +34,7 @@ public static Task InvokeAsync(this HubConnection hubConnection, string methodNa
3234
/// <param name="arg1">The first argument.</param>
3335
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None" />.</param>
3436
/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns>
37+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
3538
public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object arg1, CancellationToken cancellationToken = default)
3639
{
3740
return hubConnection.InvokeCoreAsync(methodName, new[] { arg1 }, cancellationToken);
@@ -46,6 +49,7 @@ public static Task InvokeAsync(this HubConnection hubConnection, string methodNa
4649
/// <param name="arg2">The second argument.</param>
4750
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None" />.</param>
4851
/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns>
52+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
4953
public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object arg1, object arg2, CancellationToken cancellationToken = default)
5054
{
5155
return hubConnection.InvokeCoreAsync(methodName, new[] { arg1, arg2 }, cancellationToken);
@@ -61,6 +65,7 @@ public static Task InvokeAsync(this HubConnection hubConnection, string methodNa
6165
/// <param name="arg3">The third argument.</param>
6266
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None" />.</param>
6367
/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns>
68+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
6469
public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, CancellationToken cancellationToken = default)
6570
{
6671
return hubConnection.InvokeCoreAsync(methodName, new[] { arg1, arg2, arg3 }, cancellationToken);
@@ -77,6 +82,7 @@ public static Task InvokeAsync(this HubConnection hubConnection, string methodNa
7782
/// <param name="arg4">The fourth argument.</param>
7883
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None" />.</param>
7984
/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns>
85+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
8086
public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, CancellationToken cancellationToken = default)
8187
{
8288
return hubConnection.InvokeCoreAsync(methodName, new[] { arg1, arg2, arg3, arg4 }, cancellationToken);
@@ -94,6 +100,7 @@ public static Task InvokeAsync(this HubConnection hubConnection, string methodNa
94100
/// <param name="arg5">The fifth argument.</param>
95101
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None" />.</param>
96102
/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns>
103+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
97104
public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, object arg5, CancellationToken cancellationToken = default)
98105
{
99106
return hubConnection.InvokeCoreAsync(methodName, new[] { arg1, arg2, arg3, arg4, arg5 }, cancellationToken);
@@ -112,6 +119,7 @@ public static Task InvokeAsync(this HubConnection hubConnection, string methodNa
112119
/// <param name="arg6">The sixth argument.</param>
113120
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None" />.</param>
114121
/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns>
122+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
115123
public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, object arg5, object arg6, CancellationToken cancellationToken = default)
116124
{
117125
return hubConnection.InvokeCoreAsync(methodName, new[] { arg1, arg2, arg3, arg4, arg5, arg6 }, cancellationToken);
@@ -131,6 +139,7 @@ public static Task InvokeAsync(this HubConnection hubConnection, string methodNa
131139
/// <param name="arg7">The seventh argument.</param>
132140
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None" />.</param>
133141
/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns>
142+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
134143
public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, object arg5, object arg6, object arg7, CancellationToken cancellationToken = default)
135144
{
136145
return hubConnection.InvokeCoreAsync(methodName, new[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7 }, cancellationToken);
@@ -151,6 +160,7 @@ public static Task InvokeAsync(this HubConnection hubConnection, string methodNa
151160
/// <param name="arg8">The eighth argument.</param>
152161
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None" />.</param>
153162
/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns>
163+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
154164
public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, object arg5, object arg6, object arg7, object arg8, CancellationToken cancellationToken = default)
155165
{
156166
return hubConnection.InvokeCoreAsync(methodName, new[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 }, cancellationToken);
@@ -172,6 +182,7 @@ public static Task InvokeAsync(this HubConnection hubConnection, string methodNa
172182
/// <param name="arg9">The ninth argument.</param>
173183
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None" />.</param>
174184
/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns>
185+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
175186
public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, object arg5, object arg6, object arg7, object arg8, object arg9, CancellationToken cancellationToken = default)
176187
{
177188
return hubConnection.InvokeCoreAsync(methodName, new[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 }, cancellationToken);
@@ -194,6 +205,7 @@ public static Task InvokeAsync(this HubConnection hubConnection, string methodNa
194205
/// <param name="arg10">The tenth argument.</param>
195206
/// <param name="cancellationToken">The token to monitor for cancellation requests. The default value is <see cref="CancellationToken.None" />.</param>
196207
/// <returns>A <see cref="Task"/> that represents the asynchronous invoke.</returns>
208+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
197209
public static Task InvokeAsync(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, object arg5, object arg6, object arg7, object arg8, object arg9, object arg10, CancellationToken cancellationToken = default)
198210
{
199211
return hubConnection.InvokeCoreAsync(methodName, new[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10 }, cancellationToken);

src/SignalR/clients/csharp/Client.Core/src/HubConnectionExtensions.InvokeAsyncGeneric.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5+
using System.Diagnostics.CodeAnalysis;
56
using System.Threading;
67
using System.Threading.Tasks;
78

@@ -23,6 +24,7 @@ public static partial class HubConnectionExtensions
2324
/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
2425
/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
2526
/// </returns>
27+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
2628
public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, CancellationToken cancellationToken = default)
2729
{
2830
return hubConnection.InvokeCoreAsync<TResult>(methodName, Array.Empty<object>(), cancellationToken);
@@ -40,6 +42,7 @@ public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnectio
4042
/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
4143
/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
4244
/// </returns>
45+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
4346
public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object arg1, CancellationToken cancellationToken = default)
4447
{
4548
return hubConnection.InvokeCoreAsync<TResult>(methodName, new[] { arg1 }, cancellationToken);
@@ -58,6 +61,7 @@ public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnectio
5861
/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
5962
/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
6063
/// </returns>
64+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
6165
public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object arg1, object arg2, CancellationToken cancellationToken = default)
6266
{
6367
return hubConnection.InvokeCoreAsync<TResult>(methodName, new[] { arg1, arg2 }, cancellationToken);
@@ -77,6 +81,7 @@ public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnectio
7781
/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
7882
/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
7983
/// </returns>
84+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
8085
public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, CancellationToken cancellationToken = default)
8186
{
8287
return hubConnection.InvokeCoreAsync<TResult>(methodName, new[] { arg1, arg2, arg3 }, cancellationToken);
@@ -97,6 +102,7 @@ public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnectio
97102
/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
98103
/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
99104
/// </returns>
105+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
100106
public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, CancellationToken cancellationToken = default)
101107
{
102108
return hubConnection.InvokeCoreAsync<TResult>(methodName, new[] { arg1, arg2, arg3, arg4 }, cancellationToken);
@@ -118,6 +124,7 @@ public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnectio
118124
/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
119125
/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
120126
/// </returns>
127+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
121128
public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, object arg5, CancellationToken cancellationToken = default)
122129
{
123130
return hubConnection.InvokeCoreAsync<TResult>(methodName, new[] { arg1, arg2, arg3, arg4, arg5 }, cancellationToken);
@@ -140,6 +147,7 @@ public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnectio
140147
/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
141148
/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
142149
/// </returns>
150+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
143151
public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, object arg5, object arg6, CancellationToken cancellationToken = default)
144152
{
145153
return hubConnection.InvokeCoreAsync<TResult>(methodName, new[] { arg1, arg2, arg3, arg4, arg5, arg6 }, cancellationToken);
@@ -163,6 +171,7 @@ public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnectio
163171
/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
164172
/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
165173
/// </returns>
174+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
166175
public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, object arg5, object arg6, object arg7, CancellationToken cancellationToken = default)
167176
{
168177
return hubConnection.InvokeCoreAsync<TResult>(methodName, new[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7 }, cancellationToken);
@@ -187,6 +196,7 @@ public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnectio
187196
/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
188197
/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
189198
/// </returns>
199+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
190200
public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, object arg5, object arg6, object arg7, object arg8, CancellationToken cancellationToken = default)
191201
{
192202
return hubConnection.InvokeCoreAsync<TResult>(methodName, new[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 }, cancellationToken);
@@ -212,6 +222,7 @@ public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnectio
212222
/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
213223
/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
214224
/// </returns>
225+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
215226
public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, object arg5, object arg6, object arg7, object arg8, object arg9, CancellationToken cancellationToken = default)
216227
{
217228
return hubConnection.InvokeCoreAsync<TResult>(methodName, new[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 }, cancellationToken);
@@ -238,6 +249,7 @@ public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnectio
238249
/// A <see cref="Task{TResult}"/> that represents the asynchronous invoke.
239250
/// The <see cref="Task{TResult}.Result"/> property returns a <typeparamref name="TResult"/> for the hub method return value.
240251
/// </returns>
252+
[SuppressMessage("ApiDesign", "RS0026:Do not add multiple overloads with optional parameters", Justification = "Required to maintain compatibility")]
241253
public static Task<TResult> InvokeAsync<TResult>(this HubConnection hubConnection, string methodName, object arg1, object arg2, object arg3, object arg4, object arg5, object arg6, object arg7, object arg8, object arg9, object arg10, CancellationToken cancellationToken = default)
242254
{
243255
return hubConnection.InvokeCoreAsync<TResult>(methodName, new[] { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10 }, cancellationToken);

0 commit comments

Comments
 (0)