using an env variable in c# code example
Example 1: csharp check if env is development
bool isDevelopment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development";
Example 2: c# environment variables
Environment.SetEnvironmentVariable(string variable, string value);