.Net 7.0 MemoryCache Get All Keys
| Temmuz 15, 20221 2 3 4 5 6 | var coherentState = typeof(MemoryCache).GetRuntimeFields().Where(p => p.Name == "_coherentState").FirstOrDefault(); var collectionCoherentStateType = coherentState.GetValue(memoryCache).GetType(); var collectionCoherentStateValue = coherentState.GetValue(memoryCache); var field = collectionCoherentStateType.GetProperty("EntriesCollection", BindingFlags.NonPublic | BindingFlags.Instance); var collection = field.GetValue(collectionCoherentStateValue) as ICollection; |