public static void Destruct(this IContextStore store) { foreach (var dep in store.GetContextInstances()) { dep.Cleaner?.Destruct(dep.Key, dep.Instance); } store.GetContextInstances().Clear(); }
void StoreInstanceInContext(IContextStore contextStore, string key, object instance) { contextStore[key] = instance; contextStore.GetContextInstances().Add(new ContextStoreDependency(key, instance, Resolver.Registrations)); }