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

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

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [CrudRepositoryImpl](./repository.crudrepositoryimpl.md)

## CrudRepositoryImpl class

Repository implementation

<b>Signature:</b>

```typescript
export declare class CrudRepositoryImpl<T extends Entity, ID> implements EntityCrudRepository<T, ID> 
```
<b>Implements:</b> [EntityCrudRepository](./repository.entitycrudrepository.md)

## Example

User can import `CrudRepositoryImpl` and call its functions like: `CrudRepositoryImpl.find(somefilters, someoptions)`

Or extend class `CrudRepositoryImpl` and override its functions:

```ts
export class TestRepository extends CrudRepositoryImpl<Test> {
  constructor(dataSource: DataSource, model: Test) {
    super(dataSource, Customer);
  }

  // Override `deleteAll` to disable the operation
  deleteAll(where?: Where, options?: Options) {
    return Promise.reject(new Error('deleteAll is disabled'));
  }
}
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(dataSource, entityClass)](./repository.crudrepositoryimpl._constructor_.md) |  | Constructs a new instance of the <code>CrudRepositoryImpl</code> class |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [dataSource](./repository.crudrepositoryimpl.datasource.md) |  | [DataSource](./repository.datasource.md) |  |
|  [entityClass](./repository.crudrepositoryimpl.entityclass.md) |  | typeof [Entity](./repository.entity.md) &amp; { prototype: T; } |  |
|  [inclusionResolvers](./repository.crudrepositoryimpl.inclusionresolvers.md) |  | Map&lt;string, [InclusionResolver](./repository.inclusionresolver.md)<!-- -->&lt;T, [Entity](./repository.entity.md)<!-- -->&gt;&gt; |  |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [count(where, options)](./repository.crudrepositoryimpl.count.md) |  |  |
|  [create(entity, options)](./repository.crudrepositoryimpl.create.md) |  |  |
|  [createAll(entities, options)](./repository.crudrepositoryimpl.createall.md) |  |  |
|  [delete(entity, options)](./repository.crudrepositoryimpl.delete.md) |  |  |
|  [deleteAll(where, options)](./repository.crudrepositoryimpl.deleteall.md) |  |  |
|  [deleteById(id, options)](./repository.crudrepositoryimpl.deletebyid.md) |  |  |
|  [execute(command, parameters, options)](./repository.crudrepositoryimpl.execute.md) |  |  |
|  [exists(id, options)](./repository.crudrepositoryimpl.exists.md) |  |  |
|  [find(filter, options)](./repository.crudrepositoryimpl.find.md) |  |  |
|  [findById(id, filter, options)](./repository.crudrepositoryimpl.findbyid.md) |  |  |
|  [replaceById(id, data, options)](./repository.crudrepositoryimpl.replacebyid.md) |  |  |
|  [save(entity, options)](./repository.crudrepositoryimpl.save.md) |  |  |
|  [update(entity, options)](./repository.crudrepositoryimpl.update.md) |  |  |
|  [updateAll(data, where, options)](./repository.crudrepositoryimpl.updateall.md) |  |  |
|  [updateById(id, data, options)](./repository.crudrepositoryimpl.updatebyid.md) |  |  |


