@loopback/docs
Version:
Documentation for LoopBack 4
35 lines (22 loc) • 934 B
Markdown
---
lang: en
title: 'API docs: context.context.findorcreatebinding'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.context.context.findorcreatebinding.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [Context](./context.context.md) > [findOrCreateBinding](./context.context.findorcreatebinding.md)
## Context.findOrCreateBinding() method
Find or create a binding for the given key
<b>Signature:</b>
```typescript
findOrCreateBinding<T>(key: BindingAddress<T>, policy?: BindingCreationPolicy): Binding<T>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| key | <code>BindingAddress<T></code> | Binding address |
| policy | <code>BindingCreationPolicy</code> | Binding creation policy |
<b>Returns:</b>
`Binding<T>`