Why do I get, “Culture is not supported” and What, if Anything, Should I Do about it?

前端 未结 2 1156
感动是毒
感动是毒 2020-12-18 23:31

I have a breakpoint on the \"return\" line here:

[HttpGet]
[Route(\"api/Test/{id1}/{id2}\")]
public NRBQEntity GetTestMessage(String id1, String id2)
{
    r         


        
2条回答
  •  情话喂你
    2020-12-19 00:09

    You can check all existing codes in this list.

    You can create a custom culture, like so:

    // Create a new colture, with the name you desire
    CultureAndRegionInfoBuilder cib = new CultureAndRegionInfoBuilder("en-IN", CultureAndRegionModifiers.None);
    
    // Load all defaults from en-US
    CultureInfo ci = new CultureInfo("en-US");
    cib.LoadDataFromCultureInfo(ci);
    
    // Populate the new CultureAndRegionInfoBuilder object with region information.
    RegionInfo ri = new RegionInfo("US");
    cib.LoadDataFromRegionInfo(ri);
    
    // Now you can make changes, or finish.
    // Changes can be currency, RegionName, etc.
    
    // Finish
    cib.Register();
    

    this article explains how to do it.

提交回复
热议问题