@loopback/docs
Version:
Documentation for LoopBack 4
32 lines (21 loc) • 1.1 kB
Markdown
---
lang: en
title: 'API docs: context.bindingcreationpolicy'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.context.bindingcreationpolicy.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/context](./context.md) > [BindingCreationPolicy](./context.bindingcreationpolicy.md)
## BindingCreationPolicy enum
Policy to control if a binding should be created for the context
<b>Signature:</b>
```typescript
export declare enum BindingCreationPolicy
```
## Enumeration Members
| Member | Value | Description |
| --- | --- | --- |
| ALWAYS\_CREATE | <code>"Always"</code> | Always create a binding with the key for the context |
| CREATE\_IF\_NOT\_BOUND | <code>"IfNotBound"</code> | Create a binding if the key is not bound in the context. Otherwise, return the existing binding. |
| NEVER\_CREATE | <code>"Never"</code> | Never create a binding for the context. If the key is not bound in the context, throw an error. |