From 15fa3ad10859abcc54e3ad5557dc928f6c94994d Mon Sep 17 00:00:00 2001 From: Safia Abdalla Date: Mon, 31 Jan 2022 18:17:31 -0800 Subject: [PATCH] Update SDK to 7.0.100-preview.2.22078.1 (#39895) * Update SDK to 7.0.100-preview.2.22078.1 * Fix formatting issues * Update HubEndpointRouteBuilderExtensions.cs Co-authored-by: Pranav K --- global.json | 4 ++-- src/Http/Routing/src/RouteOptions.cs | 4 ++-- .../test/EndpointMetadataApiDescriptionProviderTest.cs | 4 ++-- .../Authentication/Core/src/AuthenticationBuilder.cs | 8 ++++---- src/Security/Authentication/OAuth/src/OAuthExtensions.cs | 4 ++-- src/SignalR/server/Core/src/HubOptionsExtensions.cs | 2 +- .../server/Core/src/SignalRConnectionBuilderExtensions.cs | 2 +- .../SignalR/src/HubEndpointRouteBuilderExtensions.cs | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/global.json b/global.json index a392eec330fd..248807e744b9 100644 --- a/global.json +++ b/global.json @@ -1,9 +1,9 @@ { "sdk": { - "version": "7.0.100-alpha.1.22071.3" + "version": "7.0.100-preview.2.22078.1" }, "tools": { - "dotnet": "7.0.100-alpha.1.22071.3", + "dotnet": "7.0.100-preview.2.22078.1", "runtimes": { "dotnet": [ "2.1.30", diff --git a/src/Http/Routing/src/RouteOptions.cs b/src/Http/Routing/src/RouteOptions.cs index 2b478f26ded9..b54487f1c000 100644 --- a/src/Http/Routing/src/RouteOptions.cs +++ b/src/Http/Routing/src/RouteOptions.cs @@ -128,7 +128,7 @@ private static IDictionary GetDefaultConstraintMap() /// /// The parameter policy type. /// The route token used to apply the parameter policy. - public void SetParameterPolicy<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]T>(string token) where T : IParameterPolicy + public void SetParameterPolicy<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] T>(string token) where T : IParameterPolicy { ConstraintMap[token] = typeof(T); } @@ -149,7 +149,7 @@ public void SetParameterPolicy(string token, [DynamicallyAccessedMembers(Dynamic ConstraintMap[token] = type; } - private static void AddConstraint<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]TConstraint>(Dictionary constraintMap, string text) where TConstraint : IRouteConstraint + private static void AddConstraint<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TConstraint>(Dictionary constraintMap, string text) where TConstraint : IRouteConstraint { constraintMap[text] = typeof(TConstraint); } diff --git a/src/Mvc/Mvc.ApiExplorer/test/EndpointMetadataApiDescriptionProviderTest.cs b/src/Mvc/Mvc.ApiExplorer/test/EndpointMetadataApiDescriptionProviderTest.cs index 56c00a475b82..f933be54ce6d 100644 --- a/src/Mvc/Mvc.ApiExplorer/test/EndpointMetadataApiDescriptionProviderTest.cs +++ b/src/Mvc/Mvc.ApiExplorer/test/EndpointMetadataApiDescriptionProviderTest.cs @@ -476,7 +476,7 @@ public void AddsDisplayNameFromRouteEndpoint() [Fact] public void AddsMetadataFromRouteEndpoint() { - var apiDescription = GetApiDescription([ApiExplorerSettings(IgnoreApi = true)]() => { }); + var apiDescription = GetApiDescription([ApiExplorerSettings(IgnoreApi = true)] () => { }); Assert.NotEmpty(apiDescription.ActionDescriptor.EndpointMetadata); @@ -763,7 +763,7 @@ public void FavorsProducesMetadataOverAttribute() { // Arrange var builder = CreateBuilder(); - builder.MapGet("/api/todos", [ProducesResponseType(typeof(List), StatusCodes.Status200OK)]() => "") + builder.MapGet("/api/todos", [ProducesResponseType(typeof(List), StatusCodes.Status200OK)] () => "") .Produces(StatusCodes.Status200OK); var context = new ApiDescriptionProviderContext(Array.Empty()); diff --git a/src/Security/Authentication/Core/src/AuthenticationBuilder.cs b/src/Security/Authentication/Core/src/AuthenticationBuilder.cs index 12b878f89a4f..4d065ee9f49c 100644 --- a/src/Security/Authentication/Core/src/AuthenticationBuilder.cs +++ b/src/Security/Authentication/Core/src/AuthenticationBuilder.cs @@ -25,7 +25,7 @@ public AuthenticationBuilder(IServiceCollection services) /// public virtual IServiceCollection Services { get; } - private AuthenticationBuilder AddSchemeHelper(string authenticationScheme, string? displayName, Action? configureOptions) + private AuthenticationBuilder AddSchemeHelper(string authenticationScheme, string? displayName, Action? configureOptions) where TOptions : AuthenticationSchemeOptions, new() where THandler : class, IAuthenticationHandler { @@ -59,7 +59,7 @@ public AuthenticationBuilder(IServiceCollection services) /// The display name of this scheme. /// Used to configure the scheme options. /// The builder. - public virtual AuthenticationBuilder AddScheme(string authenticationScheme, string? displayName, Action? configureOptions) + public virtual AuthenticationBuilder AddScheme(string authenticationScheme, string? displayName, Action? configureOptions) where TOptions : AuthenticationSchemeOptions, new() where THandler : AuthenticationHandler => AddSchemeHelper(authenticationScheme, displayName, configureOptions); @@ -72,7 +72,7 @@ public AuthenticationBuilder(IServiceCollection services) /// The name of this scheme. /// Used to configure the scheme options. /// The builder. - public virtual AuthenticationBuilder AddScheme(string authenticationScheme, Action? configureOptions) + public virtual AuthenticationBuilder AddScheme(string authenticationScheme, Action? configureOptions) where TOptions : AuthenticationSchemeOptions, new() where THandler : AuthenticationHandler => AddScheme(authenticationScheme, displayName: null, configureOptions: configureOptions); @@ -87,7 +87,7 @@ public AuthenticationBuilder(IServiceCollection services) /// The display name of this scheme. /// Used to configure the scheme options. /// The builder. - public virtual AuthenticationBuilder AddRemoteScheme(string authenticationScheme, string? displayName, Action? configureOptions) + public virtual AuthenticationBuilder AddRemoteScheme(string authenticationScheme, string? displayName, Action? configureOptions) where TOptions : RemoteAuthenticationOptions, new() where THandler : RemoteAuthenticationHandler { diff --git a/src/Security/Authentication/OAuth/src/OAuthExtensions.cs b/src/Security/Authentication/OAuth/src/OAuthExtensions.cs index 73bb6c0f77af..96cee5432105 100644 --- a/src/Security/Authentication/OAuth/src/OAuthExtensions.cs +++ b/src/Security/Authentication/OAuth/src/OAuthExtensions.cs @@ -42,7 +42,7 @@ public static AuthenticationBuilder AddOAuth(this AuthenticationBuilder builder, /// The authentication scheme. /// A delegate to configure the handler specific options. /// A reference to after the operation has completed. - public static AuthenticationBuilder AddOAuth(this AuthenticationBuilder builder, string authenticationScheme, Action configureOptions) + public static AuthenticationBuilder AddOAuth(this AuthenticationBuilder builder, string authenticationScheme, Action configureOptions) where TOptions : OAuthOptions, new() where THandler : OAuthHandler => builder.AddOAuth(authenticationScheme, OAuthDefaults.DisplayName, configureOptions); @@ -55,7 +55,7 @@ public static AuthenticationBuilder AddOAuth(this AuthenticationBuilder builder, /// A display name for the authentication handler. /// A delegate to configure the handler specific options. /// A reference to after the operation has completed. - public static AuthenticationBuilder AddOAuth(this AuthenticationBuilder builder, string authenticationScheme, string displayName, Action configureOptions) + public static AuthenticationBuilder AddOAuth(this AuthenticationBuilder builder, string authenticationScheme, string displayName, Action configureOptions) where TOptions : OAuthOptions, new() where THandler : OAuthHandler { diff --git a/src/SignalR/server/Core/src/HubOptionsExtensions.cs b/src/SignalR/server/Core/src/HubOptionsExtensions.cs index 8f2aa6db88a2..4a473d863d55 100644 --- a/src/SignalR/server/Core/src/HubOptionsExtensions.cs +++ b/src/SignalR/server/Core/src/HubOptionsExtensions.cs @@ -34,7 +34,7 @@ public static void AddFilter(this HubOptions options, IHubFilter hubFilter) /// /// The type that will be added to the options. /// The options to add a filter to. - public static void AddFilter<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]TFilter>(this HubOptions options) where TFilter : IHubFilter + public static void AddFilter<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TFilter>(this HubOptions options) where TFilter : IHubFilter { _ = options ?? throw new ArgumentNullException(nameof(options)); diff --git a/src/SignalR/server/Core/src/SignalRConnectionBuilderExtensions.cs b/src/SignalR/server/Core/src/SignalRConnectionBuilderExtensions.cs index 1fdf2a4f40fd..9f3ef3105d28 100644 --- a/src/SignalR/server/Core/src/SignalRConnectionBuilderExtensions.cs +++ b/src/SignalR/server/Core/src/SignalRConnectionBuilderExtensions.cs @@ -20,7 +20,7 @@ public static class SignalRConnectionBuilderExtensions /// The type to host on the connection. /// The connection to configure. /// The same instance of the for chaining. - public static IConnectionBuilder UseHub<[DynamicallyAccessedMembers(HubAccessibility)]THub>(this IConnectionBuilder connectionBuilder) where THub : Hub + public static IConnectionBuilder UseHub<[DynamicallyAccessedMembers(HubAccessibility)] THub>(this IConnectionBuilder connectionBuilder) where THub : Hub { var marker = connectionBuilder.ApplicationServices.GetService(typeof(SignalRCoreMarkerService)); if (marker == null) diff --git a/src/SignalR/server/SignalR/src/HubEndpointRouteBuilderExtensions.cs b/src/SignalR/server/SignalR/src/HubEndpointRouteBuilderExtensions.cs index 51d5c1e40b06..b7f3aee2c106 100644 --- a/src/SignalR/server/SignalR/src/HubEndpointRouteBuilderExtensions.cs +++ b/src/SignalR/server/SignalR/src/HubEndpointRouteBuilderExtensions.cs @@ -23,7 +23,7 @@ public static class HubEndpointRouteBuilderExtensions /// The to add the route to. /// The route pattern. /// An for endpoints associated with the connections. - public static HubEndpointConventionBuilder MapHub<[DynamicallyAccessedMembers(HubAccessibility)]THub>(this IEndpointRouteBuilder endpoints, string pattern) where THub : Hub + public static HubEndpointConventionBuilder MapHub<[DynamicallyAccessedMembers(HubAccessibility)] THub>(this IEndpointRouteBuilder endpoints, string pattern) where THub : Hub { return endpoints.MapHub(pattern, configureOptions: null); } @@ -36,7 +36,7 @@ public static class HubEndpointRouteBuilderExtensions /// The route pattern. /// A callback to configure dispatcher options. /// An for endpoints associated with the connections. - public static HubEndpointConventionBuilder MapHub<[DynamicallyAccessedMembers(HubAccessibility)]THub>(this IEndpointRouteBuilder endpoints, string pattern, Action? configureOptions) where THub : Hub + public static HubEndpointConventionBuilder MapHub<[DynamicallyAccessedMembers(HubAccessibility)] THub>(this IEndpointRouteBuilder endpoints, string pattern, Action? configureOptions) where THub : Hub { var marker = endpoints.ServiceProvider.GetService();