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

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

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

Composite method decorator for OData GET endpoints.

Composes:

1. Get(path) — NestJS route decorator
2. SetMetadata(ODATA_ROUTE_KEY, { entitySetName }) — marks the route as OData
3. UseInterceptors(ODataResponseInterceptor) — wraps result in OData JSON envelope
4. UseFilters(ODataExceptionFilter) — formats errors as OData v4 error bodies

## Parameters

### entitySetName

`string`

The OData entity set name (e.g. 'Products'). Used to build
the @odata.context URL and for response formatting.

### options?

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

Optional configuration

Per D-12, D-13, RESEARCH.md Pattern 5.
Zero TypeORM imports — per PKG-01 architecture constraint.

## Returns

`MethodDecorator`
