* Creates new RequestContext instance and runs the code inside its domain. * If the handler is async, the return value needs to be awaited. * Uses `AsyncLocalStorage.run()`, suitable for regular express style middlewares with a `next` callback.
(
em: EntityManager | EntityManager[],
next: (...args: any[]) => T,
options: CreateContextOptions = {},
)
| 24 | * Uses `AsyncLocalStorage.run()`, suitable for regular express style middlewares with a `next` callback. |
| 25 | */ |
| 26 | static create<T>( |
| 27 | em: EntityManager | EntityManager[], |
| 28 | next: (...args: any[]) => T, |
| 29 | options: CreateContextOptions = {}, |
| 30 | ): T { |
| 31 | const ctx = this.createContext(em, options); |
| 32 | return this.storage.run(ctx, next); |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Creates new RequestContext instance and runs the code inside its domain. |
nothing calls this directly
no test coverage detected