---
lang: en
title: 'API docs: repository.applicationwithrepositories.datasource'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/repository
permalink: /doc/en/lb4/apidocs.repository.applicationwithrepositories.datasource.html
---

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [ApplicationWithRepositories](./repository.applicationwithrepositories.md) &gt; [dataSource](./repository.applicationwithrepositories.datasource.md)

## ApplicationWithRepositories.dataSource() method

<b>Signature:</b>

```typescript
dataSource<D extends juggler.DataSource>(dataSource: Class<D> | D, name?: string): Binding<D>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  dataSource | [Class](./repository.class.md)<!-- -->&lt;D&gt; \| D |  |
|  name | string |  |

<b>Returns:</b>

[Binding](./context.binding.md)<!-- -->&lt;D&gt;


