# Delete by Criteria

## Syntax

```
DeleteAll(filter);
```

## Arguments

<table data-header-hidden><thead><tr><th width="139">Argument</th><th width="164">Data Type</th><th width="290">Description</th><th>Default Value</th></tr></thead><tbody><tr><td><em>filter</em></td><td>Expression&#x3C;Func&#x3C;T, bool>></td><td><p>Criteria by which the records of the repository should be filtered. </p><p>This parameter must not be empty. </p></td><td>null </td></tr></tbody></table>

## Description

Deletes all records from a repository that fulfill the criteria specified in the parameter _filter_.&#x20;

## Example

### Example 1: Filtering records by only one criterion

The following program illustrates the function call with only one criterion:

```
repo.DeleteAll(x => x.ProductID == "ADAM-890-BTO");
```

Function will delete all the records from the repository that have "ADAM-567-BTO" as Production ID.

### Example 2: Filtering records by multiple criteria:

The following program illustrates the function call with multiple criteria:

```
repo.DeleteAll(x => x.ProductID == "ADAM-567-BTO" 
                 && x.Quantity > 10 
                 && x.IsUrgent == true);
```

Function will load all the records from the repository that have "ADAM-567-BTO" as Production ID, have a Quantity of more than 10 and are Urgent.
