BCQuality rule · styleAL Developmentofficial - Microsoftderived - from the source, no model text

`EntityName` is singular; `EntitySetName` is plural

EntityName and EntitySetName on an API page are the two halves of the OData naming contract. EntityName names a single record — 'customer', 'salesOrder', 'item'. EntitySetName names the collection — 'customers', 'salesOrders', 'items'.

Rule on GitHub · microsoft layer · style · BC all · tier official · derived

Description

EntityName and EntitySetName on an API page are the two halves of the OData naming contract. EntityName names a single record — 'customer', 'salesOrder', 'item'. EntitySetName names the collection — 'customers', 'salesOrders', 'items'. Swapping them — EntityName = 'customers', EntitySetName = 'customer' — produces URLs that lie to consumers: GET /customers returns one row, GET /customers('id') returns a collection. The OData conventions consumers rely on for client-side code generation depend on the singular/plural pairing being correct.

Best Practice

Pick the singular noun for EntityName and its grammatical plural for EntitySetName, both in camelCase. For compound nouns, only the trailing noun is pluralized: EntityName = 'salesOrder', EntitySetName = 'salesOrders'. For nouns whose plural is irregular, use the natural English form — EntitySetName = 'people' for EntityName = 'person'.

See sample: api-page-entity-naming-singular-plural.good.al.

Anti Pattern

EntityName = 'customers', EntitySetName = 'customer' — singular and plural swapped. Equally wrong is reusing the same form for both — EntityName = 'customer', EntitySetName = 'customer' — which breaks OData metadata parsers and client codegen.

See sample: api-page-entity-naming-singular-plural.bad.al.

Examples

Changed by


From microsoft/BCQuality at a4593a1, MIT License, Copyright (c) 2026 Microsoft Corporation (license).