private void AddWxService(IServiceCollection services) { var appId = Configuration["WxAuthInfo:AppId"]; var appSercet = Configuration["WxAuthInfo:AppSerect"]; WxContext wxContext = new WxContext(); wxContext.InitAuthInfo(appId, appSercet); services.AddSingleton(wxContext); services.AddTransient <IWxService, WxService>(); }