Base solution for your next web application
Open Closed

Dynamic webapi from module not loading #2499


User avatar
0
rbarbosa created

Hi

I've created a separate assembly inheriting from abpmodule

[DependsOn(typeof(PrizmApplicationModule))]
    public class NeoDynamicsBarcodeModule : AbpModule
    {...}
public interface INeoDynamicsBarcodeService : IApplicationService {
    string CreateLabelTest(string barCode, string labelType);
}
    public class NeoDynamicsBarcodeService : PrizmAppServiceBase, INeoDynamicsBarcodeService    {
       public string CreateLabelTest(string barCode, string labelType) {...}
}

.WebApi Project

[DependsOn(typeof(AbpWebApiModule), typeof(PrizmApplicationModule),
        typeof(NeoDynamicsBarcodeModule))]
    public class PrizmWebApiModule : AbpModule
    {...}

Am I missing anything to expose this to the public API? Initialize() method on the module is happening before the webAPI tries to register everything


1 Answer(s)
  • User Avatar
    0
    rbarbosa created

    Answered my own question...missed adding the explicit DLL

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