Skip to content

Commit b277dab

Browse files
Fix accidental obsolete (#22065)
1 parent 756227f commit b277dab

File tree

3 files changed

+2
-10
lines changed

3 files changed

+2
-10
lines changed

src/SignalR/server/Core/ref/Microsoft.AspNetCore.SignalR.Core.netcoreapp.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ public HubInvocationContext(Microsoft.AspNetCore.SignalR.HubCallerContext contex
188188
public Microsoft.AspNetCore.SignalR.Hub Hub { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
189189
public System.Reflection.MethodInfo HubMethod { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
190190
public System.Collections.Generic.IReadOnlyList<object> HubMethodArguments { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
191-
[System.ObsoleteAttribute("This property is obsolete and will be removed in a future version. Use HubMethod.Name instead.")]
192-
public string HubMethodName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
191+
public string HubMethodName { get { throw null; } }
193192
public System.IServiceProvider ServiceProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
194193
}
195194
public sealed partial class HubLifetimeContext

src/SignalR/server/Core/src/HubInvocationContext.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ public HubInvocationContext(HubCallerContext context, IServiceProvider servicePr
3131
HubMethod = hubMethod;
3232
HubMethodArguments = hubMethodArguments;
3333
Context = context;
34-
35-
#pragma warning disable CS0618 // Type or member is obsolete
36-
HubMethodName = HubMethod.Name;
37-
#pragma warning restore CS0618 // Type or member is obsolete
3834
}
3935

4036
/// <summary>
@@ -68,8 +64,7 @@ internal HubInvocationContext(ObjectMethodExecutor objectMethodExecutor, HubCall
6864
/// <summary>
6965
/// Gets the name of the Hub method being invoked.
7066
/// </summary>
71-
[Obsolete("This property is obsolete and will be removed in a future version. Use HubMethod.Name instead.")]
72-
public string HubMethodName { get; }
67+
public string HubMethodName => HubMethod.Name;
7368

7469
/// <summary>
7570
/// Gets the arguments provided by the client.

src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2233,9 +2233,7 @@ public Task HandleAsync(AuthorizationHandlerContext context)
22332233
Assert.NotNull(context.Resource);
22342234
var resource = Assert.IsType<HubInvocationContext>(context.Resource);
22352235
Assert.Equal(typeof(MethodHub), resource.Hub.GetType());
2236-
#pragma warning disable CS0618 // Type or member is obsolete
22372236
Assert.Equal(nameof(MethodHub.MultiParamAuthMethod), resource.HubMethodName);
2238-
#pragma warning restore CS0618 // Type or member is obsolete
22392237
Assert.Equal(2, resource.HubMethodArguments?.Count);
22402238
Assert.Equal("Hello", resource.HubMethodArguments[0]);
22412239
Assert.Equal("World!", resource.HubMethodArguments[1]);

0 commit comments

Comments
 (0)