选项
public static class XHelper { public static TResponse Execute( string metodo, TRequest request, IConfiguration config) { if (config is null) throw new ArgumentNullException("config"); string y = config.apiUrl; return xxx; } }
https://stackoverflow.com/questions/55213803/use-dependency-injection-in-static-class