- AppSetting bug fix - Updated testes with base test class and editor configuration changes - Created new server and wafer counter tasks json files and pipelines to match
45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using OI.Metrology.Server.Models;
|
|
using OI.Metrology.Shared.Models.Stateless;
|
|
|
|
namespace OI.Metrology.Server.Repository;
|
|
|
|
public class AppSettingsRepository : IAppSettingsRepository<AppSettings>
|
|
{
|
|
|
|
private readonly AppSettings _AppSettings;
|
|
|
|
public AppSettingsRepository(AppSettings appSettings) => _AppSettings = appSettings;
|
|
|
|
internal AppSettings GetAppSettings()
|
|
{
|
|
AppSettings result = _AppSettings;
|
|
return result;
|
|
}
|
|
|
|
AppSettings IAppSettingsRepository<AppSettings>.GetAppSettings() => GetAppSettings();
|
|
|
|
internal string GetBuildNumberAndGitCommitSeven()
|
|
{
|
|
string result = string.Concat(_AppSettings.BuildNumber, '-', _AppSettings.GitCommitSeven);
|
|
return result;
|
|
}
|
|
|
|
internal void VerifyConnectionStrings()
|
|
{
|
|
if (string.IsNullOrEmpty(_AppSettings.ConnectionString))
|
|
throw new NotSupportedException();
|
|
#if DEBUG
|
|
if (!_AppSettings.ConnectionString.Contains("test", StringComparison.CurrentCultureIgnoreCase))
|
|
throw new NotSupportedException();
|
|
#endif
|
|
#if !DEBUG
|
|
if (_AppSettings.ConnectionString.Contains("test", StringComparison.CurrentCultureIgnoreCase))
|
|
throw new NotSupportedException();
|
|
#endif
|
|
}
|
|
|
|
string IAppSettingsRepository<AppSettings>.GetBuildNumberAndGitCommitSeven() => GetBuildNumberAndGitCommitSeven();
|
|
|
|
void IAppSettingsRepository<AppSettings>.VerifyConnectionStrings() => VerifyConnectionStrings();
|
|
|
|
} |