C#C
C#3y ago
Bunda

❔ How to properly handle exceptions between API controller and service layer?

I'm creating an API and I'm having trouble figuring out how to properly catch errors between my service layer and controller. Could someone take a look at my current code and give me some advice? Useful docs or tutorials are also greatly appreciated.

To better understand the controller, this the controller route:
/api/v1/identity-users/{userRefId:guid}/risks

This is my current controller:
https://pastebin.com/Cg4CJ0QE

My service:
https://pastebin.com/KVaN3nYR
Was this page helpful?