From b277dab236ca00581fa4575674feb23ba39b4a85 Mon Sep 17 00:00:00 2001 From: Brennan Date: Wed, 20 May 2020 21:57:45 -0700 Subject: [PATCH] Fix accidental obsolete (#22065) --- .../ref/Microsoft.AspNetCore.SignalR.Core.netcoreapp.cs | 3 +-- src/SignalR/server/Core/src/HubInvocationContext.cs | 7 +------ .../server/SignalR/test/HubConnectionHandlerTests.cs | 2 -- 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/SignalR/server/Core/ref/Microsoft.AspNetCore.SignalR.Core.netcoreapp.cs b/src/SignalR/server/Core/ref/Microsoft.AspNetCore.SignalR.Core.netcoreapp.cs index f68a44862e..e01fbd72c5 100644 --- a/src/SignalR/server/Core/ref/Microsoft.AspNetCore.SignalR.Core.netcoreapp.cs +++ b/src/SignalR/server/Core/ref/Microsoft.AspNetCore.SignalR.Core.netcoreapp.cs @@ -188,8 +188,7 @@ namespace Microsoft.AspNetCore.SignalR public Microsoft.AspNetCore.SignalR.Hub Hub { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } public System.Reflection.MethodInfo HubMethod { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } public System.Collections.Generic.IReadOnlyList HubMethodArguments { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } - [System.ObsoleteAttribute("This property is obsolete and will be removed in a future version. Use HubMethod.Name instead.")] - public string HubMethodName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } + public string HubMethodName { get { throw null; } } public System.IServiceProvider ServiceProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } } public sealed partial class HubLifetimeContext diff --git a/src/SignalR/server/Core/src/HubInvocationContext.cs b/src/SignalR/server/Core/src/HubInvocationContext.cs index 1161b030ce..294e80a6a7 100644 --- a/src/SignalR/server/Core/src/HubInvocationContext.cs +++ b/src/SignalR/server/Core/src/HubInvocationContext.cs @@ -31,10 +31,6 @@ namespace Microsoft.AspNetCore.SignalR HubMethod = hubMethod; HubMethodArguments = hubMethodArguments; Context = context; - -#pragma warning disable CS0618 // Type or member is obsolete - HubMethodName = HubMethod.Name; -#pragma warning restore CS0618 // Type or member is obsolete } /// @@ -68,8 +64,7 @@ namespace Microsoft.AspNetCore.SignalR /// /// Gets the name of the Hub method being invoked. /// - [Obsolete("This property is obsolete and will be removed in a future version. Use HubMethod.Name instead.")] - public string HubMethodName { get; } + public string HubMethodName => HubMethod.Name; /// /// Gets the arguments provided by the client. diff --git a/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs b/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs index df68bf36a9..ca7b1093f3 100644 --- a/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs +++ b/src/SignalR/server/SignalR/test/HubConnectionHandlerTests.cs @@ -2233,9 +2233,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests Assert.NotNull(context.Resource); var resource = Assert.IsType(context.Resource); Assert.Equal(typeof(MethodHub), resource.Hub.GetType()); -#pragma warning disable CS0618 // Type or member is obsolete Assert.Equal(nameof(MethodHub.MultiParamAuthMethod), resource.HubMethodName); -#pragma warning restore CS0618 // Type or member is obsolete Assert.Equal(2, resource.HubMethodArguments?.Count); Assert.Equal("Hello", resource.HubMethodArguments[0]); Assert.Equal("World!", resource.HubMethodArguments[1]);