---
url: /nestjs-odata/api/generated/interfaces/IETagProvider.md
---
# Interface: IETagProvider

Defined in: [interfaces/etag.interface.ts:13](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/interfaces/etag.interface.ts#L13)

Interface for computing and validating ETags for OData entities.

Implementations are adapter-specific (e.g., TypeOrmETagProvider).
Core uses this interface without importing any ORM code.

## Methods

### computeETag()

> **computeETag**(`entity`, `etagColumn`): `string`

Defined in: [interfaces/etag.interface.ts:25](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/interfaces/etag.interface.ts#L25)

Compute a weak ETag string from an entity's ETag column value.
Format: W/"\<value>"

#### Parameters

##### entity

`Record`<`string`, `unknown`>

##### etagColumn

`string`

#### Returns

`string`

***

### getETagColumn()

> **getETagColumn**(`entitySetName`): `string` | `undefined`

Defined in: [interfaces/etag.interface.ts:19](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/interfaces/etag.interface.ts#L19)

Get the ETag column name for an entity set.
Returns undefined if the entity set is not ETag-enabled
(no

#### Parameters

##### entitySetName

`string`

#### Returns

`string` | `undefined`

#### Update Date Column

or

#### OData ETag

decorator found).

***

### validateIfMatch()

> **validateIfMatch**(`ifMatchValue`, `entity`, `etagColumn`): `boolean`

Defined in: [interfaces/etag.interface.ts:32](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/interfaces/etag.interface.ts#L32)

Validate an If-Match header value against the current entity state.
Returns true if the ETag matches (proceed with mutation),
false if the ETag is stale (return 412).

#### Parameters

##### ifMatchValue

`string`

##### entity

`Record`<`string`, `unknown`>

##### etagColumn

`string`

#### Returns

`boolean`
