Page Contents

Home > @loopback/context > ResolutionSession > runWithInjection

ResolutionSession.runWithInjection() method

Run the given action with the given injection and session

Signature:

static runWithInjection(action: ResolutionAction, injection: Readonly<Injection>, session?: ResolutionSession): any;

Parameters

Parameter Type Description
action [ResolutionAction](/doc/en/lb4/apidocs.context.resolutionaction.html) A function to do some work with the resolution session
injection Readonly<[Injection](/doc/en/lb4/apidocs.context.injection.html)>
session [ResolutionSession](/doc/en/lb4/apidocs.context.resolutionsession.html) _(Optional)_ The current resolution session

Returns:

any