© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
73 replies
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
Gyazo
Gyazo
Gyazo
Gyazo
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

❔ Pass variable type as class parameter
C#CC# / help
3y ago
Pass DateTime.Add function as parameter
C#CC# / help
4y ago
❔ Controller routing with dynamic parameter
C#CC# / help
3y ago
❔ Class with parameter as a generic parameter
C#CC# / help
4y ago