bcquality/microsoft/knowledge/style/api-page-entity-naming-singular-plural.md
Jesper Schulz-Wedde b6da405376 Improve partner onboarding and documentation navigation
Lead with a complete plugin quick start and add task-oriented usage, troubleshooting, customization, and contribution guides. Preserve the broader plugin framing, correct conflicting contract guidance, support Agents folder reviews, and align repository validation. Convert existing sample references to clickable links without changing knowledge rules.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-09 17:25:29 +02:00

1.6 KiB

bc-version domain keywords technologies countries application-area
all
style
api-page
entityname
entitysetname
singular
plural
al
w1
all

EntityName is singular; EntitySetName is plural

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.