From 15fa3ad10859abcc54e3ad5557dc928f6c94994d Mon Sep 17 00:00:00 2001 From: Safia Abdalla <safia@microsoft.com> 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 <prkrishn@hotmail.com> --- 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 a392eec330f..248807e744b 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 2b478f26ded..b54487f1c00 100644 --- a/src/Http/Routing/src/RouteOptions.cs +++ b/src/Http/Routing/src/RouteOptions.cs @@ -128,7 +128,7 @@ public class RouteOptions /// </summary> /// <typeparam name="T">The parameter policy type.</typeparam> /// <param name="token">The route token used to apply the parameter policy.</param> - 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 class RouteOptions ConstraintMap[token] = type; } - private static void AddConstraint<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]TConstraint>(Dictionary<string, Type> constraintMap, string text) where TConstraint : IRouteConstraint + private static void AddConstraint<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] TConstraint>(Dictionary<string, Type> 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 56c00a475b8..f933be54ce6 100644 --- a/src/Mvc/Mvc.ApiExplorer/test/EndpointMetadataApiDescriptionProviderTest.cs +++ b/src/Mvc/Mvc.ApiExplorer/test/EndpointMetadataApiDescriptionProviderTest.cs @@ -476,7 +476,7 @@ public class EndpointMetadataApiDescriptionProviderTest [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 class EndpointMetadataApiDescriptionProviderTest { // Arrange var builder = CreateBuilder(); - builder.MapGet("/api/todos", [ProducesResponseType(typeof(List<string>), StatusCodes.Status200OK)]() => "") + builder.MapGet("/api/todos", [ProducesResponseType(typeof(List<string>), StatusCodes.Status200OK)] () => "") .Produces<InferredJsonClass>(StatusCodes.Status200OK); var context = new ApiDescriptionProviderContext(Array.Empty<ActionDescriptor>()); diff --git a/src/Security/Authentication/Core/src/AuthenticationBuilder.cs b/src/Security/Authentication/Core/src/AuthenticationBuilder.cs index 12b878f89a4..4d065ee9f49 100644 --- a/src/Security/Authentication/Core/src/AuthenticationBuilder.cs +++ b/src/Security/Authentication/Core/src/AuthenticationBuilder.cs @@ -25,7 +25,7 @@ public class AuthenticationBuilder /// </summary> public virtual IServiceCollection Services { get; } - private AuthenticationBuilder AddSchemeHelper<TOptions, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]THandler>(string authenticationScheme, string? displayName, Action<TOptions>? configureOptions) + private AuthenticationBuilder AddSchemeHelper<TOptions, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] THandler>(string authenticationScheme, string? displayName, Action<TOptions>? configureOptions) where TOptions : AuthenticationSchemeOptions, new() where THandler : class, IAuthenticationHandler { @@ -59,7 +59,7 @@ public class AuthenticationBuilder /// <param name="displayName">The display name of this scheme.</param> /// <param name="configureOptions">Used to configure the scheme options.</param> /// <returns>The builder.</returns> - public virtual AuthenticationBuilder AddScheme<TOptions, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]THandler>(string authenticationScheme, string? displayName, Action<TOptions>? configureOptions) + public virtual AuthenticationBuilder AddScheme<TOptions, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] THandler>(string authenticationScheme, string? displayName, Action<TOptions>? configureOptions) where TOptions : AuthenticationSchemeOptions, new() where THandler : AuthenticationHandler<TOptions> => AddSchemeHelper<TOptions, THandler>(authenticationScheme, displayName, configureOptions); @@ -72,7 +72,7 @@ public class AuthenticationBuilder /// <param name="authenticationScheme">The name of this scheme.</param> /// <param name="configureOptions">Used to configure the scheme options.</param> /// <returns>The builder.</returns> - public virtual AuthenticationBuilder AddScheme<TOptions, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]THandler>(string authenticationScheme, Action<TOptions>? configureOptions) + public virtual AuthenticationBuilder AddScheme<TOptions, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] THandler>(string authenticationScheme, Action<TOptions>? configureOptions) where TOptions : AuthenticationSchemeOptions, new() where THandler : AuthenticationHandler<TOptions> => AddScheme<TOptions, THandler>(authenticationScheme, displayName: null, configureOptions: configureOptions); @@ -87,7 +87,7 @@ public class AuthenticationBuilder /// <param name="displayName">The display name of this scheme.</param> /// <param name="configureOptions">Used to configure the scheme options.</param> /// <returns>The builder.</returns> - public virtual AuthenticationBuilder AddRemoteScheme<TOptions, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]THandler>(string authenticationScheme, string? displayName, Action<TOptions>? configureOptions) + public virtual AuthenticationBuilder AddRemoteScheme<TOptions, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] THandler>(string authenticationScheme, string? displayName, Action<TOptions>? configureOptions) where TOptions : RemoteAuthenticationOptions, new() where THandler : RemoteAuthenticationHandler<TOptions> { diff --git a/src/Security/Authentication/OAuth/src/OAuthExtensions.cs b/src/Security/Authentication/OAuth/src/OAuthExtensions.cs index 73bb6c0f77a..96cee543210 100644 --- a/src/Security/Authentication/OAuth/src/OAuthExtensions.cs +++ b/src/Security/Authentication/OAuth/src/OAuthExtensions.cs @@ -42,7 +42,7 @@ public static class OAuthExtensions /// <param name="authenticationScheme">The authentication scheme.</param> /// <param name="configureOptions">A delegate to configure the handler specific options.</param> /// <returns>A reference to <paramref name="builder"/> after the operation has completed.</returns> - public static AuthenticationBuilder AddOAuth<TOptions, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]THandler>(this AuthenticationBuilder builder, string authenticationScheme, Action<TOptions> configureOptions) + public static AuthenticationBuilder AddOAuth<TOptions, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] THandler>(this AuthenticationBuilder builder, string authenticationScheme, Action<TOptions> configureOptions) where TOptions : OAuthOptions, new() where THandler : OAuthHandler<TOptions> => builder.AddOAuth<TOptions, THandler>(authenticationScheme, OAuthDefaults.DisplayName, configureOptions); @@ -55,7 +55,7 @@ public static class OAuthExtensions /// <param name="displayName">A display name for the authentication handler.</param> /// <param name="configureOptions">A delegate to configure the handler specific options.</param> /// <returns>A reference to <paramref name="builder"/> after the operation has completed.</returns> - public static AuthenticationBuilder AddOAuth<TOptions, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)]THandler>(this AuthenticationBuilder builder, string authenticationScheme, string displayName, Action<TOptions> configureOptions) + public static AuthenticationBuilder AddOAuth<TOptions, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors)] THandler>(this AuthenticationBuilder builder, string authenticationScheme, string displayName, Action<TOptions> configureOptions) where TOptions : OAuthOptions, new() where THandler : OAuthHandler<TOptions> { diff --git a/src/SignalR/server/Core/src/HubOptionsExtensions.cs b/src/SignalR/server/Core/src/HubOptionsExtensions.cs index 8f2aa6db88a..4a473d863d5 100644 --- a/src/SignalR/server/Core/src/HubOptionsExtensions.cs +++ b/src/SignalR/server/Core/src/HubOptionsExtensions.cs @@ -34,7 +34,7 @@ public static class HubOptionsExtensions /// </summary> /// <typeparam name="TFilter">The <see cref="IHubFilter"/> type that will be added to the options.</typeparam> /// <param name="options">The options to add a filter to.</param> - 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 1fdf2a4f40f..9f3ef3105d2 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 /// <typeparam name="THub">The <see cref="Hub"/> type to host on the connection.</typeparam> /// <param name="connectionBuilder">The connection to configure.</param> /// <returns>The same instance of the <see cref="IConnectionBuilder"/> for chaining.</returns> - 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 51d5c1e40b0..b7f3aee2c10 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 /// <param name="endpoints">The <see cref="IEndpointRouteBuilder"/> to add the route to.</param> /// <param name="pattern">The route pattern.</param> /// <returns>An <see cref="HubEndpointConventionBuilder"/> for endpoints associated with the connections.</returns> - 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<THub>(pattern, configureOptions: null); } @@ -36,7 +36,7 @@ public static class HubEndpointRouteBuilderExtensions /// <param name="pattern">The route pattern.</param> /// <param name="configureOptions">A callback to configure dispatcher options.</param> /// <returns>An <see cref="HubEndpointConventionBuilder"/> for endpoints associated with the connections.</returns> - public static HubEndpointConventionBuilder MapHub<[DynamicallyAccessedMembers(HubAccessibility)]THub>(this IEndpointRouteBuilder endpoints, string pattern, Action<HttpConnectionDispatcherOptions>? configureOptions) where THub : Hub + public static HubEndpointConventionBuilder MapHub<[DynamicallyAccessedMembers(HubAccessibility)] THub>(this IEndpointRouteBuilder endpoints, string pattern, Action<HttpConnectionDispatcherOptions>? configureOptions) where THub : Hub { var marker = endpoints.ServiceProvider.GetService<SignalRMarkerService>(); -- GitLab