public static void Set(AspNetCoreEnvironmentValue value) { switch (value) { case AspNetCoreEnvironmentValue.Development: AspNetCoreEnvironment.SetDevelopment(); break; case AspNetCoreEnvironmentValue.Staging: AspNetCoreEnvironment.SetStaging(); break; case AspNetCoreEnvironmentValue.Production: AspNetCoreEnvironment.SetProduction(); break; case AspNetCoreEnvironmentValue.None: AspNetCoreEnvironment.SetNone(); break; case AspNetCoreEnvironmentValue.Default: default: // Do nothing. break; } }
public static FilePath GetDefaultFilePathForEnvironment(AspNetCoreEnvironmentValue aspNetCoreEnvironment) { var defaultFileName = AppSettings.GetDefaultFileNameForEnvironment(aspNetCoreEnvironment); var defaultFilePath = PathUtilitiesExtra.RelativeToCurrentDirectory(defaultFileName); return(defaultFilePath); }
public static FileName GetFileNameForEnvironment(AspNetCoreEnvironmentValue aspNetCoreEnvironment) { var aspNetCoreEnvironmentName = aspNetCoreEnvironment.ToStringStandard(); var output = AppSettings.GetJsonFileNameForEnvironment(Constants.AppSettingsBaseFileNameWithoutExtension, aspNetCoreEnvironmentName); return(output); }
/// <summary> /// Returns the ASP.NET Core environment-specific default appsettings file name. /// </summary> public static FileName GetDefaultFileNameForEnvironment(AspNetCoreEnvironmentValue aspNetCoreEnvironment) { switch (aspNetCoreEnvironment) { case AspNetCoreEnvironmentValue.Development: return(AppSettings.DefaultDevelopmentJsonFileName); case AspNetCoreEnvironmentValue.Staging: return(AppSettings.DefaultStagingJsonFileName); case AspNetCoreEnvironmentValue.Production: return(AppSettings.DefaultProductionJsonFileName); case AspNetCoreEnvironmentValue.Default: case AspNetCoreEnvironmentValue.None: default: return(AppSettings.DefaultJsonFileName); } }
public static string GetEnvironmentSpecificRootDirectoryPath(string rootDirectoryPath, AspNetCoreEnvironmentValue aspNetCoreEnvironment) { var aspNetCoreEnvironmentString = aspNetCoreEnvironment.ToStringStandard(); var output = Path.Combine(rootDirectoryPath, aspNetCoreEnvironmentString); return(output); }