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

I wanna add a Service in a new .Net library project #4578


User avatar
0
[email protected] created

How can I add a new Service implementation in a new assembly?

I have added the interface in the ProjectName.Application.Shared library, and I added the service imlementation to the new assembly.

How the references should be? and how asp.net zero will create a new controller automatically? What's the required dependecy injection actions to make all the services in the new assembly exposed automatically as controller.


2 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    Do this in YourWebCoreModule:

    Configuration.Modules.AbpAspNetCore()
        .CreateControllersForAppServices(
            typeof(YourNewApplicationModule).GetAssembly()
        );
    
  • User Avatar
    0
    [email protected] created

    Thanks, working!