C
C#2y ago
.

✅ REST Create-endpoint best practice.

I am creating an endpoint to add a user. The Users table is related with the Roles table. How should I implement the transfer of the user's role: accept a string with the name of the role, and throw an error if there is no such role? Or accept role id and have an endpoint to get all roles?
2 Replies
JakenVeina
JakenVeina2y ago
if your roles HAVE IDs, you should use those identify entities by their primary key just in general
.
.OP2y ago
Thank you!
Want results from more Discord servers?
Add your server