Fix accidental obsolete (#22065)

This commit is contained in:
Brennan 2020-05-20 21:57:45 -07:00 committed by GitHub
parent 756227f0ce
commit b277dab236
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 10 deletions

View File

@ -188,8 +188,7 @@ namespace Microsoft.AspNetCore.SignalR
public Microsoft.AspNetCore.SignalR.Hub Hub { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } 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.Reflection.MethodInfo HubMethod { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
public System.Collections.Generic.IReadOnlyList<object> HubMethodArguments { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } public System.Collections.Generic.IReadOnlyList<object> 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 { get { throw null; } }
public string HubMethodName { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
public System.IServiceProvider ServiceProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } } public System.IServiceProvider ServiceProvider { [System.Runtime.CompilerServices.CompilerGeneratedAttribute] get { throw null; } }
} }
public sealed partial class HubLifetimeContext public sealed partial class HubLifetimeContext

View File

@ -31,10 +31,6 @@ namespace Microsoft.AspNetCore.SignalR
HubMethod = hubMethod; HubMethod = hubMethod;
HubMethodArguments = hubMethodArguments; HubMethodArguments = hubMethodArguments;
Context = context; Context = context;
#pragma warning disable CS0618 // Type or member is obsolete
HubMethodName = HubMethod.Name;
#pragma warning restore CS0618 // Type or member is obsolete
} }
/// <summary> /// <summary>
@ -68,8 +64,7 @@ namespace Microsoft.AspNetCore.SignalR
/// <summary> /// <summary>
/// Gets the name of the Hub method being invoked. /// Gets the name of the Hub method being invoked.
/// </summary> /// </summary>
[Obsolete("This property is obsolete and will be removed in a future version. Use HubMethod.Name instead.")] public string HubMethodName => HubMethod.Name;
public string HubMethodName { get; }
/// <summary> /// <summary>
/// Gets the arguments provided by the client. /// Gets the arguments provided by the client.

View File

@ -2233,9 +2233,7 @@ namespace Microsoft.AspNetCore.SignalR.Tests
Assert.NotNull(context.Resource); Assert.NotNull(context.Resource);
var resource = Assert.IsType<HubInvocationContext>(context.Resource); var resource = Assert.IsType<HubInvocationContext>(context.Resource);
Assert.Equal(typeof(MethodHub), resource.Hub.GetType()); Assert.Equal(typeof(MethodHub), resource.Hub.GetType());
#pragma warning disable CS0618 // Type or member is obsolete
Assert.Equal(nameof(MethodHub.MultiParamAuthMethod), resource.HubMethodName); Assert.Equal(nameof(MethodHub.MultiParamAuthMethod), resource.HubMethodName);
#pragma warning restore CS0618 // Type or member is obsolete
Assert.Equal(2, resource.HubMethodArguments?.Count); Assert.Equal(2, resource.HubMethodArguments?.Count);
Assert.Equal("Hello", resource.HubMethodArguments[0]); Assert.Equal("Hello", resource.HubMethodArguments[0]);
Assert.Equal("World!", resource.HubMethodArguments[1]); Assert.Equal("World!", resource.HubMethodArguments[1]);