diff --git a/FastGithub.Configuration/DnsConfig.cs b/FastGithub.Configuration/DnsConfig.cs index 21dd80e..a35ed0f 100644 --- a/FastGithub.Configuration/DnsConfig.cs +++ b/FastGithub.Configuration/DnsConfig.cs @@ -6,18 +6,18 @@ namespace FastGithub.Configuration /// /// dns配置 /// - public class DnsConfig + public record DnsConfig { /// /// IP地址 /// [AllowNull] - public string IPAddress { get; set; } + public string IPAddress { get; init; } /// /// 端口 /// - public int Port { get; set; } = 53; + public int Port { get; init; } = 53; /// /// 转换为IPEndPoint @@ -38,10 +38,5 @@ namespace FastGithub.Configuration return new IPEndPoint(address, this.Port); } - - public override string ToString() - { - return $"{this.IPAddress}:{this.Port}"; - } } }