---
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

|  Parameter | Type | Description |
|  --- | --- | --- |
|  action | [ResolutionAction](./context.resolutionaction.md) | A function to do some work with the resolution session |
|  binding | Readonly&lt;[Binding](./context.binding.md)<!-- -->&gt; | The current binding |
|  session | [ResolutionSession](./context.resolutionsession.md) | _(Optional)_ The current resolution session |

**Returns:**

any


