Ejemplo n.º 1
0
 internal ContextualReflectionScope(AssemblyLoadContext?activating)
 {
     _predecessor = AssemblyLoadContext.CurrentContextualReflectionContext;
     AssemblyLoadContext.SetCurrentContextualReflectionContext(activating);
     _activated   = activating;
     _initialized = true;
 }
Ejemplo n.º 2
0
 public void Dispose()
 {
     if (_initialized)
     {
         // Do not clear initialized. Always restore the _predecessor in Dispose()
         // _initialized = false;
         AssemblyLoadContext.SetCurrentContextualReflectionContext(_predecessor);
     }
 }