Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renaming DisableImplicitFromServicesParameters option #40047

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/SignalR/server/Core/src/HubConnectionHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ IServiceScopeFactory serviceScopeFactory
_maximumMessageSize = _hubOptions.MaximumReceiveMessageSize;
_enableDetailedErrors = _hubOptions.EnableDetailedErrors ?? _enableDetailedErrors;
_maxParallelInvokes = _hubOptions.MaximumParallelInvocationsPerClient;
disableImplicitFromServiceParameters = _hubOptions.DisableImplicitFromServiceParameters;
disableImplicitFromServiceParameters = _hubOptions.DisableImplicitFromServicesParameters;

if (_hubOptions.HubFilters != null)
{
Expand All @@ -82,7 +82,7 @@ IServiceScopeFactory serviceScopeFactory
_maximumMessageSize = _globalHubOptions.MaximumReceiveMessageSize;
_enableDetailedErrors = _globalHubOptions.EnableDetailedErrors ?? _enableDetailedErrors;
_maxParallelInvokes = _globalHubOptions.MaximumParallelInvocationsPerClient;
disableImplicitFromServiceParameters = _globalHubOptions.DisableImplicitFromServiceParameters;
disableImplicitFromServiceParameters = _globalHubOptions.DisableImplicitFromServicesParameters;

if (_globalHubOptions.HubFilters != null)
{
Expand Down
2 changes: 1 addition & 1 deletion src/SignalR/server/Core/src/HubOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,5 @@ public int MaximumParallelInvocationsPerClient
/// <remarks>
/// False by default. Hub method arguments will be resolved from a DI container if possible.
/// </remarks>
public bool DisableImplicitFromServiceParameters { get; set; }
public bool DisableImplicitFromServicesParameters { get; set; }
}
2 changes: 1 addition & 1 deletion src/SignalR/server/Core/src/HubOptionsSetup`T.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void Configure(HubOptions<THub> options)
options.MaximumReceiveMessageSize = _hubOptions.MaximumReceiveMessageSize;
options.StreamBufferCapacity = _hubOptions.StreamBufferCapacity;
options.MaximumParallelInvocationsPerClient = _hubOptions.MaximumParallelInvocationsPerClient;
options.DisableImplicitFromServiceParameters = _hubOptions.DisableImplicitFromServiceParameters;
options.DisableImplicitFromServicesParameters = _hubOptions.DisableImplicitFromServicesParameters;

options.UserHasSetValues = true;

Expand Down
4 changes: 2 additions & 2 deletions src/SignalR/server/Core/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#nullable enable
Microsoft.AspNetCore.SignalR.HubOptions.DisableImplicitFromServiceParameters.get -> bool
Microsoft.AspNetCore.SignalR.HubOptions.DisableImplicitFromServiceParameters.set -> void
Microsoft.AspNetCore.SignalR.HubOptions.DisableImplicitFromServicesParameters.get -> bool
Microsoft.AspNetCore.SignalR.HubOptions.DisableImplicitFromServicesParameters.set -> void
6 changes: 3 additions & 3 deletions src/SignalR/server/SignalR/test/AddSignalRTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public void HubSpecificOptionsHaveSameValuesAsGlobalHubOptions()
Assert.Equal(globalHubOptions.SupportedProtocols, hubOptions.SupportedProtocols);
Assert.Equal(globalHubOptions.ClientTimeoutInterval, hubOptions.ClientTimeoutInterval);
Assert.Equal(globalHubOptions.MaximumParallelInvocationsPerClient, hubOptions.MaximumParallelInvocationsPerClient);
Assert.Equal(globalHubOptions.DisableImplicitFromServiceParameters, hubOptions.DisableImplicitFromServiceParameters);
Assert.Equal(globalHubOptions.DisableImplicitFromServicesParameters, hubOptions.DisableImplicitFromServicesParameters);
Assert.True(hubOptions.UserHasSetValues);
}

Expand Down Expand Up @@ -146,7 +146,7 @@ public void UserSpecifiedOptionsRunAfterDefaultOptions()
options.SupportedProtocols = null;
options.ClientTimeoutInterval = TimeSpan.FromSeconds(1);
options.MaximumParallelInvocationsPerClient = 3;
options.DisableImplicitFromServiceParameters = true;
options.DisableImplicitFromServicesParameters = true;
});

var serviceProvider = serviceCollection.BuildServiceProvider();
Expand All @@ -160,7 +160,7 @@ public void UserSpecifiedOptionsRunAfterDefaultOptions()
Assert.Null(globalOptions.SupportedProtocols);
Assert.Equal(3, globalOptions.MaximumParallelInvocationsPerClient);
Assert.Equal(TimeSpan.FromSeconds(1), globalOptions.ClientTimeoutInterval);
Assert.True(globalOptions.DisableImplicitFromServiceParameters);
Assert.True(globalOptions.DisableImplicitFromServicesParameters);
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4695,7 +4695,7 @@ public async Task ServiceNotResolvedWithoutAttribute_WithSettingDisabledGlobally
provider.AddSignalR(options =>
{
options.EnableDetailedErrors = true;
options.DisableImplicitFromServiceParameters = true;
options.DisableImplicitFromServicesParameters = true;
});
provider.AddSingleton<Service1>();
});
Expand Down Expand Up @@ -4738,10 +4738,10 @@ public async Task ServiceResolvedWithoutAttribute_WithHubSpecificSettingEnabled(
provider.AddSignalR(options =>
{
options.EnableDetailedErrors = true;
options.DisableImplicitFromServiceParameters = true;
options.DisableImplicitFromServicesParameters = true;
}).AddHubOptions<ServicesHub>(options =>
{
options.DisableImplicitFromServiceParameters = false;
options.DisableImplicitFromServicesParameters = false;
});
provider.AddSingleton<Service1>();
});
Expand All @@ -4763,7 +4763,7 @@ public async Task ServiceNotResolvedWithAndWithoutAttribute_WithOptionDisabled()
provider.AddSignalR(options =>
{
options.EnableDetailedErrors = true;
options.DisableImplicitFromServiceParameters = true;
options.DisableImplicitFromServicesParameters = true;
});
provider.AddSingleton<Service1>();
provider.AddSingleton<Service2>();
Expand Down