---
lang: en
title: 'API docs: repository.defaultkeyvaluerepository._constructor_'
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.defaultkeyvaluerepository._constructor_.html
---

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [DefaultKeyValueRepository](./repository.defaultkeyvaluerepository.md) &gt; [(constructor)](./repository.defaultkeyvaluerepository._constructor_.md)

## DefaultKeyValueRepository.(constructor)

Construct a KeyValueRepository with a legacy DataSource

<b>Signature:</b>

```typescript
constructor(entityClass: typeof Model & {
        prototype: T;
    }, ds: juggler.DataSource);
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  entityClass | typeof [Model](./repository.model.md) &amp; { prototype: T; } |  |
|  ds | juggler.DataSource | Legacy DataSource |


