@loopback/docs
Version:
Documentation for LoopBack 4
36 lines (23 loc) • 1.11 kB
Markdown
lang: en
title: 'API docs: context.resolutionsession.runwithinjection'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.context.resolutionsession.runwithinjection.html
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [ResolutionSession](./context.resolutionsession.md) > [runWithInjection](./context.resolutionsession.runwithinjection.md)
## ResolutionSession.runWithInjection() method
Run the given action with the given injection and session
<b>Signature:</b>
```typescript
static runWithInjection(action: ResolutionAction, injection: Readonly<Injection>, session?: ResolutionSession): any;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| action | <code>ResolutionAction</code> | A function to do some work with the resolution session |
| injection | <code>Readonly<Injection></code> | |
| session | <code>ResolutionSession</code> | The current resolution session |
<b>Returns:</b>
`any`