/// <summary> /// 打印内部封装的缓存池 /// </summary> /// <param name="option1"></param> /// <param name="_optionsSnapshot1"></param> private void PrintOptionCatch(IOptions <OrderOption> option1, IOptionsSnapshot <OrderOption> _optionsSnapshot1) { var catch1 = option1.GetFieldValue("_cache").GetFieldValue("_cache"); Console.WriteLine($"option1缓存({catch1.GetHashCode()}):{catch1.AsFormatJsonStr()}"); var catch2 = _optionsSnapshot1.GetFieldValue("_cache").GetFieldValue("_cache"); Console.WriteLine($"option2缓存({catch2.GetHashCode()}):{catch2.AsFormatJsonStr()}"); }
/// <summary> /// 打印内部封装的缓存池 /// </summary> private void PrintOptionCatch() { var catch1 = _option1.GetFieldValue("_cache").GetFieldValue("_cache"); Console.WriteLine($"option1缓存({catch1.GetHashCode()}):{catch1.AsFormatJsonStr()}"); var catch2 = _optionsSnapshot1.GetFieldValue("_cache").GetFieldValue("_cache"); Console.WriteLine($"optionsSnapshot1缓存({catch2.GetHashCode()}):{catch2.AsFormatJsonStr()}"); var catch3 = _optionsMonitor1.GetFieldValue("_cache").GetFieldValue("_cache"); Console.WriteLine($"optionsMonitor1缓存({catch3.GetHashCode()}):{catch3.AsFormatJsonStr()}"); }