public static void InjectDisposable <T>(this INestedContainer nc, T instance, bool replace = false) { if (replace && nc.GetInstance <T>() is IDisposable old) { old.Dispose(); } nc.Inject(instance, replace); ((Scope)nc).TryAddDisposable(instance); }
public static void UpdateScope(this INestedContainer container, ConsumeContext consumeContext) { container.Inject(consumeContext); }
public static void InjectDisposable <T>(this INestedContainer nc, T instance, bool replace = false) { nc.Inject(instance, replace); ((Scope)nc).TryAddDisposable(instance); }
public void UseContext(ExplorerContext ctx) => scope.Inject(ctx);