Check out example codes for "csharp check if env is development". It will help you in understanding the concepts better.

Code Example 1

bool isDevelopment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == "Development";

Learn ReactJs, React Native from akashmittal.com