oi-metrology/Server/Repositories/ClientSettingsRepository.cs
Mike Phares 5c9f0d1aff Remove with Text
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
2024-04-15 13:13:55 -07:00

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);
}