Przeglądaj źródła

项目重命名

xljiulang 4 lat temu
rodzic
commit
04f8d77aaf
33 zmienionych plików z 118 dodań i 69 usunięć
  1. 1 1
      FastGithub.Configuration/DnsConfig.cs
  2. 3 3
      FastGithub.Configuration/DomainConfig.cs
  3. 1 1
      FastGithub.Configuration/DomainPattern.cs
  4. 8 0
      FastGithub.Configuration/FastGithub.Configuration.csproj
  5. 1 1
      FastGithub.Configuration/FastGithubConfig.cs
  6. 1 1
      FastGithub.Configuration/FastGithubException.cs
  7. 1 1
      FastGithub.Configuration/FastGithubOptions.cs
  8. 1 1
      FastGithub.Configuration/ResponseConfig.cs
  9. 24 0
      FastGithub.Configuration/ServiceCollectionExtensions.cs
  10. 1 1
      FastGithub.Configuration/TlsSniPattern.cs
  11. 0 12
      FastGithub.Core/FastGithub.Core.csproj
  12. 2 1
      FastGithub.Dns/DnsHostedService.cs
  13. 1 1
      FastGithub.Dns/FastGithub.Dns.csproj
  14. 2 1
      FastGithub.Dns/HostsFileValidator.cs
  15. 1 0
      FastGithub.Dns/RequestResolver.cs
  16. 7 7
      FastGithub.Dns/ServiceCollectionExtensions.cs
  17. 2 1
      FastGithub.DomainResolve/DnscryptProxyService.cs
  18. 1 0
      FastGithub.DomainResolve/DomainResolver.cs
  19. 8 5
      FastGithub.DomainResolve/FastGithub.DomainResolve.csproj
  20. 3 4
      FastGithub.DomainResolve/ServiceCollectionExtensions.cs
  21. 0 1
      FastGithub.Http/FastGithub.Http.csproj
  22. 2 1
      FastGithub.Http/HttpClient.cs
  23. 2 1
      FastGithub.Http/HttpClientFactory.cs
  24. 3 1
      FastGithub.Http/IHttpClientFactory.cs
  25. 3 1
      FastGithub.Http/RequestContext.cs
  26. 2 2
      FastGithub.Http/ServiceCollectionExtensions.cs
  27. 0 1
      FastGithub.ReverseProxy/FastGithub.ReverseProxy.csproj
  28. 3 2
      FastGithub.ReverseProxy/ReverseProxyMiddleware.cs
  29. 0 1
      FastGithub.Upgrade/FastGithub.Upgrade.csproj
  30. 23 0
      FastGithub.Upgrade/ServiceCollectionExtensions.cs
  31. 2 1
      FastGithub.Upgrade/UpgradeService.cs
  32. 6 6
      FastGithub.sln
  33. 3 9
      FastGithub/Startup.cs

+ 1 - 1
FastGithub.Core/DnsConfig.cs → FastGithub.Configuration/DnsConfig.cs

@@ -2,7 +2,7 @@
 using System.Net;
 using System.Net.NetworkInformation;
 
-namespace FastGithub
+namespace FastGithub.Configuration
 {
     /// <summary>
     /// dns配置

+ 3 - 3
FastGithub.Core/DomainConfig.cs → FastGithub.Configuration/DomainConfig.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace FastGithub
+namespace FastGithub.Configuration
 {
     /// <summary>
     /// 域名配置
@@ -47,11 +47,11 @@ namespace FastGithub
         {
             if (this.TlsSni == false)
             {
-                return FastGithub.TlsSniPattern.None;
+                return Configuration.TlsSniPattern.None;
             }
             if (string.IsNullOrEmpty(this.TlsSniPattern))
             {
-                return FastGithub.TlsSniPattern.Domain;
+                return Configuration.TlsSniPattern.Domain;
             }
             return new TlsSniPattern(this.TlsSniPattern);
         }

+ 1 - 1
FastGithub.Core/DomainPattern.cs → FastGithub.Configuration/DomainPattern.cs

@@ -1,7 +1,7 @@
 using System;
 using System.Text.RegularExpressions;
 
-namespace FastGithub
+namespace FastGithub.Configuration
 {
     /// <summary>
     /// 表示域名表达式

+ 8 - 0
FastGithub.Configuration/FastGithub.Configuration.csproj

@@ -0,0 +1,8 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+	<ItemGroup>
+		<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0-*" />
+		<PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0-*" />
+	</ItemGroup>
+
+</Project>

+ 1 - 1
FastGithub.Core/FastGithubConfig.cs → FastGithub.Configuration/FastGithubConfig.cs

@@ -7,7 +7,7 @@ using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Net;
 
-namespace FastGithub
+namespace FastGithub.Configuration
 {
     /// <summary>
     /// FastGithub配置

+ 1 - 1
FastGithub.Core/FastGithubException.cs → FastGithub.Configuration/FastGithubException.cs

@@ -1,6 +1,6 @@
 using System;
 
-namespace FastGithub
+namespace FastGithub.Configuration
 {
     /// <summary>
     /// 表示FastGithub异常

+ 1 - 1
FastGithub.Core/FastGithubOptions.cs → FastGithub.Configuration/FastGithubOptions.cs

@@ -1,6 +1,6 @@
 using System.Collections.Generic;
 
-namespace FastGithub
+namespace FastGithub.Configuration
 {
     /// <summary>
     /// FastGithub的配置

+ 1 - 1
FastGithub.Core/ResponseConfig.cs → FastGithub.Configuration/ResponseConfig.cs

@@ -1,4 +1,4 @@
-namespace FastGithub
+namespace FastGithub.Configuration
 {
     /// <summary>
     /// 响应配置

+ 24 - 0
FastGithub.Configuration/ServiceCollectionExtensions.cs

@@ -0,0 +1,24 @@
+using FastGithub.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.DependencyInjection.Extensions;
+using Microsoft.Extensions.Options;
+
+namespace FastGithub
+{
+    /// <summary>
+    /// 服务注册扩展
+    /// </summary>
+    public static class ServiceCollectionExtensions
+    {
+        /// <summary>
+        /// 添加配置服务
+        /// </summary>
+        /// <param name="services"></param> 
+        /// <returns></returns>
+        public static OptionsBuilder<FastGithubOptions> AddConfiguration(this IServiceCollection services)
+        {
+            services.TryAddSingleton<FastGithubConfig>();
+            return services.AddOptions<FastGithubOptions>();
+        }
+    }
+}

+ 1 - 1
FastGithub.Core/TlsSniPattern.cs → FastGithub.Configuration/TlsSniPattern.cs

@@ -1,7 +1,7 @@
 using System;
 using System.Net;
 
-namespace FastGithub
+namespace FastGithub.Configuration
 {
     /// <summary>
     /// Sni自定义值表达式

+ 0 - 12
FastGithub.Core/FastGithub.Core.csproj

@@ -1,12 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-	<PropertyGroup> 
-		<RootNamespace>FastGithub</RootNamespace>
-	</PropertyGroup>
-
-	<ItemGroup> 
-	  <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.0-*" /> 
-	  <PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0-*" />
-	</ItemGroup>  
-  
-</Project>

+ 2 - 1
FastGithub.Dns/DnsHostedService.cs

@@ -1,4 +1,5 @@
-using Microsoft.Extensions.Hosting;
+using FastGithub.Configuration;
+using Microsoft.Extensions.Hosting;
 using Microsoft.Extensions.Logging;
 using Microsoft.Extensions.Options;
 using System;

+ 1 - 1
FastGithub.Dns/FastGithub.Dns.csproj

@@ -10,6 +10,6 @@
 	</ItemGroup>
 
 	<ItemGroup>
-	  <ProjectReference Include="..\FastGithub.Core\FastGithub.Core.csproj" />
+	  <ProjectReference Include="..\FastGithub.Configuration\FastGithub.Configuration.csproj" />
 	</ItemGroup>
 </Project>

+ 2 - 1
FastGithub.Dns/HostsFileValidator.cs

@@ -1,4 +1,5 @@
-using Microsoft.Extensions.Logging;
+using FastGithub.Configuration;
+using Microsoft.Extensions.Logging;
 using System;
 using System.Collections.Generic;
 using System.IO;

+ 1 - 0
FastGithub.Dns/RequestResolver.cs

@@ -1,6 +1,7 @@
 using DNS.Client.RequestResolver;
 using DNS.Protocol;
 using DNS.Protocol.ResourceRecords;
+using FastGithub.Configuration;
 using Microsoft.Extensions.Logging;
 using System;
 using System.Linq;

+ 7 - 7
FastGithub.Dns/DnsServiceCollectionExtensions.cs → FastGithub.Dns/ServiceCollectionExtensions.cs

@@ -1,12 +1,13 @@
 using FastGithub.Dns;
 using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.DependencyInjection.Extensions;
 
 namespace FastGithub
 {
     /// <summary>
-    /// dns服务注册扩展
+    /// 服务注册扩展
     /// </summary>
-    public static class DnsServiceCollectionExtensions
+    public static class ServiceCollectionExtensions
     {
         /// <summary>
         /// 注册dns服务
@@ -15,11 +16,10 @@ namespace FastGithub
         /// <returns></returns>
         public static IServiceCollection AddDnsServer(this IServiceCollection services)
         {
-            return services
-                .AddSingleton<RequestResolver>()
-                .AddSingleton<DnsServer>()
-                .AddSingleton<HostsFileValidator>()
-                .AddHostedService<DnsHostedService>();
+            services.TryAddSingleton<RequestResolver>();
+            services.TryAddSingleton<DnsServer>();
+            services.TryAddSingleton<HostsFileValidator>();
+            return services.AddHostedService<DnsHostedService>();
         }
     }
 }

+ 2 - 1
FastGithub.DomainResolve/DnscryptProxyService.cs

@@ -1,4 +1,5 @@
-using System;
+using FastGithub.Configuration;
+using System;
 using System.Diagnostics;
 using System.Linq;
 using System.Threading;

+ 1 - 0
FastGithub.DomainResolve/DomainResolver.cs

@@ -1,5 +1,6 @@
 using DNS.Client;
 using DNS.Protocol;
+using FastGithub.Configuration;
 using Microsoft.Extensions.Caching.Memory;
 using Microsoft.Extensions.Logging;
 using System;

+ 8 - 5
FastGithub.DomainResolve/FastGithub.DomainResolve.csproj

@@ -4,31 +4,34 @@
     <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="6.0.0-*" />
     <PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.0-*" />
     <PackageReference Include="DNS" Version="6.1.0" />
-    <ProjectReference Include="..\FastGithub.Core\FastGithub.Core.csproj" />
   </ItemGroup>
 
   <ItemGroup>
-    <None Include="../@dnscrypt-proxy/dnscrypt-proxy.toml" Link="dnscrypt-proxy.toml" >
+    <None Include="../@dnscrypt-proxy/dnscrypt-proxy.toml" Link="dnscrypt-proxy.toml">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>
 
   <ItemGroup Condition="'$(RuntimeIdentifier)' == 'win-x64'">
-    <None Include="../@dnscrypt-proxy/windows-x64/dnscrypt-proxy.exe" Link="dnscrypt-proxy.exe" >
+    <None Include="../@dnscrypt-proxy/windows-x64/dnscrypt-proxy.exe" Link="dnscrypt-proxy.exe">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>
 
   <ItemGroup Condition="'$(RuntimeIdentifier)' == 'linux-x64'">
-    <None Include="../@dnscrypt-proxy/linux-x64/dnscrypt-proxy" Link="dnscrypt-proxy" >
+    <None Include="../@dnscrypt-proxy/linux-x64/dnscrypt-proxy" Link="dnscrypt-proxy">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>
 
   <ItemGroup Condition="'$(RuntimeIdentifier)' == 'osx-x64'">
-    <None Include="../@dnscrypt-proxy/osx-x64/dnscrypt-proxy" Link="dnscrypt-proxy" >
+    <None Include="../@dnscrypt-proxy/osx-x64/dnscrypt-proxy" Link="dnscrypt-proxy">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
   </ItemGroup>
 
+  <ItemGroup>
+    <ProjectReference Include="..\FastGithub.Configuration\FastGithub.Configuration.csproj" />
+  </ItemGroup>
+
 </Project>

+ 3 - 4
FastGithub.DomainResolve/DomainResolveServiceCollectionExtensions.cs → FastGithub.DomainResolve/ServiceCollectionExtensions.cs

@@ -5,9 +5,9 @@ using Microsoft.Extensions.DependencyInjection.Extensions;
 namespace FastGithub
 {
     /// <summary>
-    ///  域名解析相关服务注册扩展
+    /// 服务注册扩展
     /// </summary>
-    public static class DomainResolveServiceCollectionExtensions
+    public static class ServiceCollectionExtensions
     {
         /// <summary>
         /// 注册域名解析相关服务
@@ -19,8 +19,7 @@ namespace FastGithub
             services.AddMemoryCache();
             services.TryAddSingleton<IDomainResolver, DomainResolver>();
             services.TryAddSingleton<DnscryptProxyService>();
-            services.AddHostedService<DnscryptProxyHostedService>();
-            return services;
+            return services.AddHostedService<DnscryptProxyHostedService>();
         }
     }
 }

+ 0 - 1
FastGithub.Http/FastGithub.Http.csproj

@@ -2,7 +2,6 @@
 
 	<ItemGroup>
 		<PackageReference Include="Portable.BouncyCastle" Version="1.8.10" />
-		<ProjectReference Include="..\FastGithub.Core\FastGithub.Core.csproj" />
 		<ProjectReference Include="..\FastGithub.DomainResolve\FastGithub.DomainResolve.csproj" />
 	</ItemGroup>
 

+ 2 - 1
FastGithub.Http/HttpClient.cs

@@ -1,4 +1,5 @@
-using FastGithub.DomainResolve;
+using FastGithub.Configuration;
+using FastGithub.DomainResolve;
 using System;
 using System.Net.Http;
 using System.Threading;

+ 2 - 1
FastGithub.Http/HttpClientFactory.cs

@@ -1,4 +1,5 @@
-using FastGithub.DomainResolve;
+using FastGithub.Configuration;
+using FastGithub.DomainResolve;
 using Microsoft.Extensions.Options;
 
 namespace FastGithub.Http

+ 3 - 1
FastGithub.Http/IHttpClientFactory.cs

@@ -1,4 +1,6 @@
-namespace FastGithub.Http
+using FastGithub.Configuration;
+
+namespace FastGithub.Http
 {
     /// <summary>
     /// httpClient工厂

+ 3 - 1
FastGithub.Http/RequestContext.cs

@@ -1,4 +1,6 @@
-namespace FastGithub.Http
+using FastGithub.Configuration;
+
+namespace FastGithub.Http
 {
     /// <summary>
     /// 表示请求上下文

+ 2 - 2
FastGithub.Http/HttpClientServiceCollectionExtensions.cs → FastGithub.Http/ServiceCollectionExtensions.cs

@@ -5,9 +5,9 @@ using Microsoft.Extensions.DependencyInjection.Extensions;
 namespace FastGithub
 {
     /// <summary>
-    /// httpClient的服务注册扩展
+    /// 服务注册扩展
     /// </summary>
-    public static class HttpClientServiceCollectionExtensions
+    public static class ServiceCollectionExtensions
     {
         /// <summary>
         /// 添加HttpClient相关服务

+ 0 - 1
FastGithub.ReverseProxy/FastGithub.ReverseProxy.csproj

@@ -11,7 +11,6 @@
 	</ItemGroup>
 
 	<ItemGroup>
-		<ProjectReference Include="..\FastGithub.Core\FastGithub.Core.csproj" />
 		<ProjectReference Include="..\FastGithub.Http\FastGithub.Http.csproj" />
 	</ItemGroup>
 

+ 3 - 2
FastGithub.ReverseProxy/ReverseProxyMiddleware.cs

@@ -1,4 +1,5 @@
-using FastGithub.Http;
+using FastGithub.Configuration;
+using FastGithub.Http;
 using Microsoft.AspNetCore.Http;
 using Microsoft.Extensions.Logging;
 using System;
@@ -22,7 +23,7 @@ namespace FastGithub.ReverseProxy
             IHttpClientFactory httpClientFactory,
             FastGithubConfig fastGithubConfig,
             ILogger<ReverseProxyMiddleware> logger)
-        {
+        { 
             this.httpForwarder = httpForwarder;
             this.httpClientFactory = httpClientFactory;
             this.fastGithubConfig = fastGithubConfig;

+ 0 - 1
FastGithub.Upgrade/FastGithub.Upgrade.csproj

@@ -5,7 +5,6 @@
   </ItemGroup>
 
   <ItemGroup>
-    <ProjectReference Include="..\FastGithub.Core\FastGithub.Core.csproj" />
     <ProjectReference Include="..\FastGithub.Http\FastGithub.Http.csproj" />
   </ItemGroup>
 

+ 23 - 0
FastGithub.Upgrade/ServiceCollectionExtensions.cs

@@ -0,0 +1,23 @@
+using FastGithub.Upgrade;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.DependencyInjection.Extensions;
+
+namespace FastGithub
+{
+    /// <summary>
+    /// 服务注册扩展
+    /// </summary>
+    public static class ServiceCollectionExtensions
+    {
+        /// <summary>
+        /// 添加升级服务
+        /// </summary>
+        /// <param name="services"></param> 
+        /// <returns></returns>
+        public static IServiceCollection AddUpgrade(this IServiceCollection services)
+        {
+            services.TryAddSingleton<UpgradeService>();
+            return services;
+        }
+    }
+}

+ 2 - 1
FastGithub.Upgrade/UpgradeService.cs

@@ -1,4 +1,5 @@
-using FastGithub.DomainResolve;
+using FastGithub.Configuration;
+using FastGithub.DomainResolve;
 using FastGithub.Http;
 using Microsoft.Extensions.Logging;
 using System;

+ 6 - 6
FastGithub.sln

@@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.31320.298
 MinimumVisualStudioVersion = 10.0.40219.1
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub", "FastGithub\FastGithub.csproj", "{C1099390-6103-4917-A740-A3002B542FE0}"
 EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.Core", "FastGithub.Core\FastGithub.Core.csproj", "{4E4841D2-F743-40BB-BE28-729DB53775CC}"
-EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.Dns", "FastGithub.Dns\FastGithub.Dns.csproj", "{43FF9C79-51D5-4037-AA0B-CA3006E2A7E6}"
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.Upgrade", "FastGithub.Upgrade\FastGithub.Upgrade.csproj", "{8239A077-A84C-4FDF-A204-02A2DE4243F3}"
@@ -17,6 +15,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.Http", "FastGith
 EndProject
 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.DomainResolve", "FastGithub.DomainResolve\FastGithub.DomainResolve.csproj", "{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}"
 EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastGithub.Configuration", "FastGithub.Configuration\FastGithub.Configuration.csproj", "{C63CEBB1-56DA-4AC3-BDC9-52424EC292A0}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
@@ -27,10 +27,6 @@ Global
 		{C1099390-6103-4917-A740-A3002B542FE0}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{C1099390-6103-4917-A740-A3002B542FE0}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{C1099390-6103-4917-A740-A3002B542FE0}.Release|Any CPU.Build.0 = Release|Any CPU
-		{4E4841D2-F743-40BB-BE28-729DB53775CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{4E4841D2-F743-40BB-BE28-729DB53775CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{4E4841D2-F743-40BB-BE28-729DB53775CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{4E4841D2-F743-40BB-BE28-729DB53775CC}.Release|Any CPU.Build.0 = Release|Any CPU
 		{43FF9C79-51D5-4037-AA0B-CA3006E2A7E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{43FF9C79-51D5-4037-AA0B-CA3006E2A7E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{43FF9C79-51D5-4037-AA0B-CA3006E2A7E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -51,6 +47,10 @@ Global
 		{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{5D26ABDD-F341-4EB7-9D08-FCB80F79B4B4}.Release|Any CPU.Build.0 = Release|Any CPU
+		{C63CEBB1-56DA-4AC3-BDC9-52424EC292A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{C63CEBB1-56DA-4AC3-BDC9-52424EC292A0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{C63CEBB1-56DA-4AC3-BDC9-52424EC292A0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{C63CEBB1-56DA-4AC3-BDC9-52424EC292A0}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 3 - 9
FastGithub/Startup.cs

@@ -1,4 +1,3 @@
-using FastGithub.Upgrade;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
@@ -27,15 +26,12 @@ namespace FastGithub
         /// <param name="services"></param>
         public void ConfigureServices(IServiceCollection services)
         {
+            services.AddConfiguration().Bind(this.Configuration.GetSection(nameof(FastGithub)));
             services.AddDnsServer();
             services.AddDomainResolve();
             services.AddHttpClient();
             services.AddReverseProxy();
-
-            services.AddSingleton<FastGithubConfig>();
-            services.Configure<FastGithubOptions>(this.Configuration.GetSection(nameof(FastGithub)));
-
-            services.AddSingleton<UpgradeService>();
+            services.AddUpgrade();
             services.AddHostedService<HostedService>();
 
             services.AddControllersWithViews();
@@ -53,9 +49,7 @@ namespace FastGithub
             app.UseRouting();
             app.UseEndpoints(endpoints =>
             {
-                endpoints.MapControllerRoute(
-                     name: "default",
-                     pattern: "{controller=Home}/{action=Index}/{id?}");
+                endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
             });
         }
     }