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

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

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [asProvider](./context.asprovider.md)

## asProvider() function

A factory function to create a template function to bind the target class as a `Provider`<!-- -->.

**Signature:**

```typescript
export declare function asProvider<T>(target: Constructor<Provider<T>>): BindingTemplate<T>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  target | [Constructor](./context.constructor.md)<!-- -->&lt;[Provider](./context.provider.md)<!-- -->&lt;T&gt;&gt; | Target provider class |

**Returns:**

[BindingTemplate](./context.bindingtemplate.md)<!-- -->&lt;T&gt;


