Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Core equivalent for ASP.NET MVC BeginExecuteCore

I am migrating from ASP.NET MVC to ASP.NET Core and the later does not have a BeginExecuteCore method in Controller.

Do you know a method in ASP.NET Core Controller that I could use to set Thread.CurrentThread.CurrentUICulture before the Request Action is called?

like image 764
Alvaro Rodriguez Scelza Avatar asked Oct 25 '25 01:10

Alvaro Rodriguez Scelza


1 Answers

After some litle code diving inside of Microsoft.AspNetCore.Mvc package, I found that the class Controller has a couple of methods that help to control the execution of every Request Action.

This are OnActionExecuted and OnActionExecuting. Which run after and before the action execution respectively.

In my case, OnActionExecuting did the trick.

like image 142
Alvaro Rodriguez Scelza Avatar answered Oct 26 '25 16:10

Alvaro Rodriguez Scelza



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!