---
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) &gt; [@loopback/context](./context.md) &gt; [ResolutionSession](./context.resolutionsession.md) &gt; [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&lt;Injection&gt;</code> |  |
|  session | <code>ResolutionSession</code> | The current resolution session |

<b>Returns:</b>

`any`


