Esempio n. 1
0
 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);
 }
Esempio n. 3
0
 public static void InjectDisposable <T>(this INestedContainer nc, T instance, bool replace = false)
 {
     nc.Inject(instance, replace);
     ((Scope)nc).TryAddDisposable(instance);
 }
Esempio n. 4
0
 public void UseContext(ExplorerContext ctx) => scope.Inject(ctx);