refactor: 重构代码

This commit is contained in:
Argo Zhang 2025-10-19 15:19:00 +08:00
parent 0caff12306
commit b94123fee3
1 changed files with 2 additions and 2 deletions

View File

@ -19,9 +19,9 @@ public static class IP2RegionExtensions
return new Searcher(cachePolicy, path); return new Searcher(cachePolicy, path);
}); });
#if NET8_0_OR_GREATER #if NET8_0_OR_GREATER
services.AddKeyedSingleton<ISearcher>("IP2Region.Net", (provider, _) => services.AddKeyedSingleton("IP2Region.Net", (provider, _) =>
{ {
return new Searcher(cachePolicy, path); return provider.GetRequiredService<ISearcher>();
}); });
#endif #endif