---
url: /nestjs-odata/api/generated/functions/ODataPatch.md
---
# Function: ODataPatch()

> **ODataPatch**(`entitySetName`, `options?`): `MethodDecorator`

Defined in: [decorators/odata-patch.decorator.ts:22](https://github.com/cberd1509/nestjs-odata/blob/a42974292d62fe5da337a603d3b22d57c08cbf68/packages/core/src/decorators/odata-patch.decorator.ts#L22)

Composite method decorator for OData PATCH (update) endpoints.

Composes:

1. Patch(path) — NestJS route decorator, defaults to ':key'
2. SetMetadata(ODATA_ROUTE_KEY, { entitySetName, operation: 'update', isSingleEntity: true })
3. UseInterceptors(ODataResponseInterceptor) — wraps result in single-entity OData envelope
4. UseFilters(ODataExceptionFilter) — formats errors as OData v4 error bodies

Per D-01: merge-patch semantics. Per D-02: parenthetical key via ':key' param.
Zero TypeORM imports — per PKG-01 architecture constraint.

## Parameters

### entitySetName

`string`

### options?

[`ODataPatchOptions`](../interfaces/ODataPatchOptions.md)

## Returns

`MethodDecorator`
