public IDisposable Change(IWeChatOfficialOptions weChatOfficialOptions) { var parentScope = _weChatOfficialAsyncLocalAccessor.Current; _weChatOfficialAsyncLocalAccessor.Current = weChatOfficialOptions; return(new DisposeAction(() => { _weChatOfficialAsyncLocalAccessor.Current = parentScope; })); }
public WeChatOfficialAsyncLocal(IWeChatOfficialAsyncLocalAccessor weChatOfficialAsyncLocalAccessor) { _weChatOfficialAsyncLocalAccessor = weChatOfficialAsyncLocalAccessor; CurrentOptions = weChatOfficialAsyncLocalAccessor.Current; }