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

Appservices instead of controllers #7695


User avatar
0
antonis created

About using appservices instead of controllers how is this done? My main concern is that affects performance. Does it use reflection?

Thanks


1 Answer(s)
  • User Avatar
    0
    ryancyq created
    Support Team

    Hi @antonis, application service classes are converted from POCO into AspNetCore MVC Controller during application bootstraping stage. It does use reflection to extract the configurations but it is only done once when the application started.

    The CreateControllersForAppServices method gets an assembly and converts all the application services to MVC controllers in that assembly. You can use the RemoteService attribute to enable or disable it for the class or it's methods.

    For reference https://aspnetboilerplate.com/Pages/Documents/AspNet-Core#application-services-as-controllers