Open Closed

How to create an API controller in the HttpApi project of an ABP Blazor WebAssembly Application? #7172


User avatar
0
vinhlam0112 created
  • ABP Framework version: v8.1.1
  • UI Type: Blazor WASM
  • Database System: EF Core (PostgreSQL)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

I'm trying to create an API controller in the HttpApi project, but I'm facing issues with Auto API Controllers. I'm attempting to create a Products API controller, but when I run the source code, Swagger can't find the APIs I've built. Could you please assist me in creating an API Products controller in the HttpApi project that can work properly in an ABP Blazor WebAssembly Application?


6 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Could you share the full steps to reproduce? thanks.

  • User Avatar
    0
    vinhlam0112 created

    Hi,

    Could you share the full steps to reproduce? thanks.

    My intention is to manually create an API controller in the HttpApi project of an ABP Blazor WebAssembly Application, without relying on Auto API Controllers. However, I couldn't find specific articles guiding me on this matter.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    What kind of API controller? Could you share the code?

  • User Avatar
    0
    vinhlam0112 created

    This is my code: My swagger:

    I can't find my GetDataByProcedure route in Swagger. I might be missing something somewhere. Could you help me address this issue?

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Remove abstract keyword

  • User Avatar
    0
    vinhlam0112 created

    Remove abstract keyword

    I feel so silly. Thank you, Liangshiwei.

Made with ❤️ on ABP v8.2.0-preview Updated on března 25, 2024, 15:11