Remove GetEngineeringSpcReview Better error message EnforceCodeStyleInBuild NginxFileSystem Remove Reactors and Working Directory AppSettings Delete self contained Thunder Tests Back to .net8.0 api/v4/InfinityQS ApiExplorerSettings Wafer Counter
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using OI.Metrology.Server.Models;
|
|
using OI.Metrology.Shared.Models.Stateless;
|
|
using System.Net;
|
|
|
|
namespace OI.Metrology.Server.Repository;
|
|
|
|
public class ClientSettingsRepository : IClientSettingsRepository
|
|
{
|
|
|
|
private readonly AppSettings _AppSettings;
|
|
|
|
public ClientSettingsRepository(AppSettings appSettings) => _AppSettings = appSettings;
|
|
|
|
internal List<string> GetClientSettings(IPAddress? remoteIpAddress)
|
|
{
|
|
List<string> results = new() { remoteIpAddress is null ? nameof(remoteIpAddress) : remoteIpAddress.ToString() };
|
|
if (!_AppSettings.IsDevelopment)
|
|
throw new Exception("Shouldn't expose!");
|
|
return results;
|
|
}
|
|
|
|
internal static string GetIpAddress(IPAddress? remoteIpAddress)
|
|
{
|
|
string result = remoteIpAddress is null ? string.Empty : remoteIpAddress.ToString();
|
|
return result;
|
|
}
|
|
|
|
List<string> IClientSettingsRepository.GetClientSettings(IPAddress? remoteIpAddress) => GetClientSettings(remoteIpAddress);
|
|
|
|
string IClientSettingsRepository.GetIpAddress(IPAddress? remoteIpAddress) => GetIpAddress(remoteIpAddress);
|
|
|
|
} |