13 lines
No EOL
630 B
C#
13 lines
No EOL
630 B
C#
using System.Net;
|
|
using System.Reflection;
|
|
|
|
namespace Insight.Domain.Constants
|
|
{
|
|
public static class Configuration
|
|
{
|
|
public static string Hostname => Dns.GetHostEntry("localhost").HostName;
|
|
public static Version Version => Assembly.GetEntryAssembly()?.GetName().Version ?? throw new ArgumentNullException("Version");
|
|
public static DirectoryInfo? AppDirectory => string.IsNullOrWhiteSpace(Environment.ProcessPath) ? null : new DirectoryInfo(Environment.ProcessPath).Parent;
|
|
public static string DefaultConfig => Path.Combine(AppDirectory?.FullName ?? string.Empty, "config.json");
|
|
}
|
|
} |