Skip to content

Add [DisallowNull] on id parameters #1571

@bkoelman

Description

@bkoelman

Controllers, resource services, repositories, repository accessors, and IQueryLayerComposer should be annotated with [DisallowNull] for method parameters named id. While it can be null in the resource type itself (to support zero values), they should never be for incoming requests.

Adding this annotation produces a compiler warning when called directly from custom code.

We can't add the notnull constraint on TId, because that breaks the contract with IIdentifiable<TId>.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions