-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is the module not using auto api controllers? #1731
Comments
https://docs.abp.io/en/abp/latest/Best-Practices/Module-Architecture#http-layer HTTP API package only depends on the Application.Contracts package. It does not depend on the Application package. |
@maliming
I used So, is there a win-win approach that can use the auto api controller and follow the best practice? |
Thanks to @maliming , I got it. |
@wakuflair Hi! How did you solve this issue ? |
Hi @felipemoreira2x public override void ConfigureServices(ServiceConfigurationContext context)
{
...
// Auto controllers
Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.Create(typeof(YourModuleApplicationModule).Assembly);
});
} |
For the modules, we couldn't find a way of using auto api controllers without depending on the application service implementation, unfortunately. |
Thanks @wakuflair. It worked. |
It's not exactly a win-win situation ,it only works on single applications. In the gateway layer of the microservice, there is no way to get an interface definition, because it does not rely on ApplicationModuel and those Api for proxy cannot be automatically generated
|
Yes you are right. |
I noticed that auto api controllers are not used in the template of the module, but instead the controller class is defined (eg SampleController).
However, you also know that creating a controller for each application service is a tedious job, so I want to know why the auto api controller is not used in modules? Is this a violation of the best practice?
The text was updated successfully, but these errors were encountered: