- hi:
- I customized a module project, which runs in a multi-layers project. There is an API interface in the multi-layers project. How to call this api interface of the host in the module project
5 Answer(s)
-
0
Hi, you can use static or dynamic C# API Proxies. Here is the documentation for both approaches:
- https://abp.io/docs/latest/framework/api-development/static-csharp-clients
- https://abp.io/docs/latest/framework/api-development/dynamic-csharp-clients
Also, we provide Modular Monolith tutorial, you can check that: https://abp.io/docs/latest/tutorials/modular-crm
-
0
-
0
[dhaoo] said:
hi: Through the document, I saw the requirements for dynamic or static agents. The interface under the Contracts project can implement the agent, but this interface definition does not exist in the module program of the multi-layer project. What should I do now
Do you have an application service interface defined in your
*.Application.Contracts
project and referenced in your other module? Typically, in ABP, application service contracts are placed in the*.Application.Contracts
layer, and other modules reference that project to access the services.You can refer to the Service Interface section in the document for more info.
-
0
[EngincanV] said:
[dhaoo] said:
hi:
Through the document, I saw the requirements for dynamic or static agents. The interface under the Contracts project can implement the agent, but this interface definition does not exist in the module program of the multi-layer project. What should I do nowDo you have an application service interface defined in your
*.Application.Contracts
project and referenced in your other module? Typically, in ABP, application service contracts are placed in the*.Application.Contracts
layer, and other modules reference that project to access the services.You can refer to the Service Interface section in the document for more info.
Must the interface defined by *.Application.Contracts be referenced in the module to implement the proxy? Is it referenced in the *.HttpApi project or in the *.httpapi.client
-
0
[dhaoo] said: Must the interface defined by *.Application.Contracts be referenced in the module to implement the proxy? Is it referenced in the *.HttpApi project or in the *.httpapi.client
Yes, we suggest defining in a shared library between client and secret, so you can use the application service interface in your client application and generate a proxy for that. (https://abp.io/docs/latest/framework/api-development/static-csharp-clients#service-interface)
Otherwise, you might need to create a httpclient instance yourself, and send a request to the related service endpoint manually. Please refer to https://abp.io/docs/latest/framework/api-development/static-csharp-clients#service-interface for more information.
Regards.