diff options
Diffstat (limited to 'src/Http/Routing/test/testassets/RoutingSandbox/Framework/FrameworkEndpointRouteBuilderExtensions.cs')
-rw-r--r-- | src/Http/Routing/test/testassets/RoutingSandbox/Framework/FrameworkEndpointRouteBuilderExtensions.cs | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/Http/Routing/test/testassets/RoutingSandbox/Framework/FrameworkEndpointRouteBuilderExtensions.cs b/src/Http/Routing/test/testassets/RoutingSandbox/Framework/FrameworkEndpointRouteBuilderExtensions.cs index 47cb6ea28b..2c6676ff21 100644 --- a/src/Http/Routing/test/testassets/RoutingSandbox/Framework/FrameworkEndpointRouteBuilderExtensions.cs +++ b/src/Http/Routing/test/testassets/RoutingSandbox/Framework/FrameworkEndpointRouteBuilderExtensions.cs @@ -11,29 +11,28 @@ using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing.Patterns; using Microsoft.Extensions.DependencyInjection; -namespace RoutingSandbox.Framework +namespace RoutingSandbox.Framework; + +public static class FrameworkEndpointRouteBuilderExtensions { - public static class FrameworkEndpointRouteBuilderExtensions + public static IEndpointConventionBuilder MapFramework(this IEndpointRouteBuilder endpoints, Action<FrameworkConfigurationBuilder> configure) { - public static IEndpointConventionBuilder MapFramework(this IEndpointRouteBuilder endpoints, Action<FrameworkConfigurationBuilder> configure) + if (endpoints == null) + { + throw new ArgumentNullException(nameof(endpoints)); + } + if (configure == null) { - if (endpoints == null) - { - throw new ArgumentNullException(nameof(endpoints)); - } - if (configure == null) - { - throw new ArgumentNullException(nameof(configure)); - } + throw new ArgumentNullException(nameof(configure)); + } - var dataSource = endpoints.ServiceProvider.GetRequiredService<FrameworkEndpointDataSource>(); + var dataSource = endpoints.ServiceProvider.GetRequiredService<FrameworkEndpointDataSource>(); - var configurationBuilder = new FrameworkConfigurationBuilder(dataSource); - configure(configurationBuilder); + var configurationBuilder = new FrameworkConfigurationBuilder(dataSource); + configure(configurationBuilder); - endpoints.DataSources.Add(dataSource); + endpoints.DataSources.Add(dataSource); - return dataSource; - } + return dataSource; } } |