---
lang: en
title: 'API docs: context.resolutionsession.runwithbinding'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context
permalink: /doc/en/lb4/apidocs.context.resolutionsession.runwithbinding.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; [runWithBinding](./context.resolutionsession.runwithbinding.md)

## ResolutionSession.runWithBinding() method

Run the given action with the given binding and session

**Signature:**

```typescript
static runWithBinding(action: ResolutionAction, binding: Readonly<Binding>, session?: ResolutionSession): any;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

action


</td><td>

[ResolutionAction](./context.resolutionaction.md)


</td><td>

A function to do some work with the resolution session


</td></tr>
<tr><td>

binding


</td><td>

Readonly&lt;[Binding](./context.binding.md)<!-- -->&gt;


</td><td>

The current binding


</td></tr>
<tr><td>

session


</td><td>

[ResolutionSession](./context.resolutionsession.md)


</td><td>

_(Optional)_ The current resolution session


</td></tr>
</tbody></table>
**Returns:**

any


