diff --git a/global.json b/global.json index a392eec330fd5c8ba513d60c81c7f345c0f53b14..248807e744b947ab4f08c1977da8a747c1d5d9a5 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 2b478f26ded9947019944adcdd60d38ea6f24f7c..b54487f1c000a1f418a110e422cf0cfc37aa7651 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 56c00a475b822606d54d0e43540ca1f438646b81..f933be54ce6d2c8b27a64a105b223496cc54c61d 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 12b878f89a4fbe68c03479232b53b84b0545c81c..4d065ee9f49c8b360d7c6c820a8ae5edc9a478c0 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 73bb6c0f77aff917305c123604f64857aac849f6..96cee5432105597828936f0a16484ae63b43d624 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 8f2aa6db88a2f28e2367723c2164ade7ef9932a2..4a473d863d55dadd9ee778aa0b4d2886c937cb4c 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 1fdf2a4f40fdb0153b6d4061120e9093f7ef8422..9f3ef3105d282de1bd2ee9453b86411135adce15 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 51d5c1e40b067d1f4462d6bf50b84529832879c6..b7f3aee2c1060e72000a83a60cd19a4dd62cb72b 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>();