Utopia-Canteen-System/Services/ConfigConnectionHelper.cs

18 lines
647 B
C#

namespace UtopiaCanteenSystem.Services;
/// <summary>
/// Resolves the effective HRMS/UIND MySQL connection: explicit HRMS lookup string when set,
/// otherwise the production <see cref="IConfigService.GetMySqlConnectionString"/> value.
/// </summary>
public static class ConfigConnectionHelper
{
public static string GetHrmsOrProductionConnectionString(string? hrmsLookupConnectionString, string? mySqlConnectionString)
{
var hrms = (hrmsLookupConnectionString ?? string.Empty).Trim();
if (!string.IsNullOrWhiteSpace(hrms))
return hrms;
return (mySqlConnectionString ?? string.Empty).Trim();
}
}