---
lang: en
title: 'API docs: context.asprovider'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
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`<!-- -->.

<b>Signature:</b>

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

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  target | <code>Constructor&lt;Provider&lt;unknown&gt;&gt;</code> | Target provider class |

<b>Returns:</b>

`BindingTemplate`


