Calling a Controller at server side #7294
-
Please I need some assistance calling HttpPost method in a controller class, I tried using JsonServiceClient, but I get an error message
This is the controller:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Instead calling endpoint, you can create a service
|
Beta Was this translation helpful? Give feedback.
Instead calling endpoint, you can create a service
LeaveRequestEmailSender
with interfaceILeaveRequestEmailSender
, then you can call it from your endpoint. And also you can inject this interface in any of your class in the project. Endpoints hasHttpContext
and requires some pipelines like authorization etc. Don't call endpoints in the projects unless strict requirements.