Stashbox by Peter Csajtai

<PackageReference Include="Stashbox" Version="3.2.1-preview-571" />

 ResolutionContext

public class ResolutionContext
Represents information about the actual resolution flow.

The context of the current container instance.

The currently resolving scope.

public bool IsRequestedFromRoot { get; }

When it's true, it indicates that the current resolution request was made from the root scope.

public bool NullResultAllowed { get; }

True if null result is allowed, otherwise false.

public void AddDefinedVariable(int key, ParameterExpression parameter)

Adds a global keyed variable to the compiled expression tree.

public void AddDefinedVariable(ParameterExpression parameter)

Adds a global variable to the compiled expression tree.

public void AddInstruction(Expression instruction)

Adds a custom expression to the instruction list

Gets an already defined global variable.