Open Closed

module && multi-layers #9375


User avatar
0
dhaoo created
  • 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)
  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    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

  • User Avatar
    0
    dhaoo created

    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

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    [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.

  • User Avatar
    0
    dhaoo created

    [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 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.

    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

  • User Avatar
    0
    EngincanV created
    Support Team .NET Developer

    [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.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on June 13, 2025, 11:37