Do you know that WebAPI and table names should be consistent?
  v4.0 Posted at 23/10/2020 1:36 PM by Matt Goldman
​When creating WebAPIs for your applications, it is useful to keep the naming consistent all the way from the back-end to the front-end.

Table name: Employees
Endpoint: /api/Users

​Bad Example: The endpoint is different to the table name

​Table name: Employees
Endpoint: /api/Employees

​Good Example: Table name is the same as the WebAPI endpoint

By making the endpoint name the same as the table name, you can simplify development and maintenance of the WebAPI layer.

In some circumstances you may not have direct control over the database, and sometimes you may be exposing a resource that doesn't have a meaningful analogue in the database. In these situations, it may make sense to have different endpoint names - if doing so will simplify development for consumers of your WebAPI endpoints.​

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address: