Get the current culture in a controller asp.net-core

前端 未结 5 917
隐瞒了意图╮
隐瞒了意图╮ 2021-02-05 01:26

I have setup the cultures for my views and changing the culture in a controller but I can\'t seem to find how to know what culture I\'m currently using in a controller, I\'m loo

5条回答
  •  清歌不尽
    2021-02-05 01:55

    There's a global property CultureInfo.CurrentCulture in the System.Globalization namespace that gets the culture for the current thread. This has existed as far back as .NET Framework 4.0, and all the way through to the current version of .NET Core 3.1.

提交回复
热议问题