问题
The Azure SDK for Java has an enum with all of the Azure locations, public and national.
Is there similar functionality available for C#? It would be cleaner than using strings.
回答1:
Is there similar functionality available for C#?
Yes, please refer to Microsoft.Azure.Management.ResourceManager.Fluent, we could get source code from github. More details please refer to screenshot.
demo code:
string region = Region.AsiaEast.ToString();
来源:https://stackoverflow.com/questions/44770406/how-can-i-get-the-list-of-azure-regions-in-c