---
lang: en
title: 'API docs: context.dynamicvalueproviderclass'
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.dynamicvalueproviderclass.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [DynamicValueProviderClass](./context.dynamicvalueproviderclass.md)

## DynamicValueProviderClass interface

A class with a static `value` method as the factory function for `toDynamicValue`<!-- -->.

<b>Signature:</b>

```typescript
export interface DynamicValueProviderClass<T = unknown> extends Constructor<unknown>, Function 
```
<b>Extends:</b> [Constructor](./context.constructor.md)<!-- -->&lt;unknown&gt;, Function

## Example


```ts
import {inject} from '@loopback/context';

export class DynamicGreetingProvider {
  static value(@inject('currentUser') user: string) {
    return `Hello, ${user}`;
  }
}
```

## Properties

|  Property | Type | Description |
|  --- | --- | --- |
|  [value](./context.dynamicvalueproviderclass.value.md) | (...args: [BoundValue](./context.boundvalue.md)<!-- -->\[\]) =&gt; [ValueOrPromise](./context.valueorpromise.md)<!-- -->&lt;T&gt; |  |


