Alecu
Alecu

Reputation: 2708

How are controller actions invoked Asp .Net Core?

I have been wondering how controller actions are invoked in Asp .Net Core after a request has been matched to an action based on the configured routes.

Are they invoked by reflection? If they are invoked this way there would be quite a performance impact.

Or are the routes and corresponding controllers dynamically compiled in some way so that the actions from the controllers are invoked directly.

Upvotes: 1

Views: 812

Answers (1)

mm8
mm8

Reputation: 169350

Since ASP.NET Core is open sourced, you can browse the source code at GitHub.

More specifically, look at the ControllerActionInvoker and ControllerActionInvokerCacheEntry classes in the dotnet/aspnetcore repo.

Upvotes: 6

Related Questions