C#C
C#3y ago
dragzun

✅ Pass status as parameter in controller

Hello, I am trying to retrieve a list of Active Employees, for this purpose, I have a separate domain where I keep my logic by having a GetActiveEmployees method. Then in my controller, I am calling the method but I want my endpoint to be : GET api/employees?status=active. My question is how can I pass the status which should always be active. At the moment the issue is that whatever I put in as status, it still works, whereas I want to have it work only if the status is active.

Here is my domain logic :
https://gyazo.com/7eb168cb68a632d14a28b3c1f1ecc3c9
and here is my controller :
https://gyazo.com/8c907a7ddcadd79b6a95f4ef0a1dc185
Gyazo
Gyazo
Was this page helpful?