Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

How to generate dynamic API for multiple modules frm differe #2072


User avatar
0
birthdaycensus created

This is what I am having in the Initialize method of my WebApiModule

Configuration.Modules.AbpWebApi().DynamicApiControllerBuilder
                .ForAll<IApplicationService>(typeof(KolaApplicationModule).Assembly, "app")
                .Build();

Configuration.Modules.AbpWebApi().DynamicApiControllerBuilder
                .ForAll<IApplicationService>(typeof(KolaContentApplicationModule).Assembly, "content")
                .Build();

In the KolaContentApplicationModule, I have ICategoryAppService that has a method GetCategory(int id) I am trying to access this method from the endpoint, /api/services/content/category/GetCategory?id=10 I got the error, "No HTTP resource was found that matches the request URI 'http://localhost:6634/api/services/content/category/GetCategory?id=10'." But when I move ICategoryAppService to the KolaApplicationModule, I can access it from /api/services/app/category/GetCategory?id=10

Note that KolaContentApplicationModule is in a different project. In the Initialize method of the KolaContentApplicationModule , I have made the call,

IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());

What am I doing wrong, please


No answer yet!