-
-
Notifications
You must be signed in to change notification settings - Fork 242
/
Copy pathDnsZone.cs
43 lines (31 loc) · 906 Bytes
/
DnsZone.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Globalization;
namespace KeyVault.Acmebot.Providers;
public class DnsZone : IEquatable<DnsZone>
{
public DnsZone(IDnsProvider dnsProvider)
{
DnsProvider = dnsProvider;
}
private static readonly IdnMapping s_idnMapping = new();
private readonly string _name;
public string Id { get; init; }
public string Name
{
get => _name;
init => _name = s_idnMapping.GetAscii(value);
}
public IReadOnlyList<string> NameServers { get; init; }
public IDnsProvider DnsProvider { get; }
public bool Equals(DnsZone other)
{
if (other is null)
{
return false;
}
return Id == other.Id;
}
public override bool Equals(object obj) => Equals(obj as DnsZone);
public override int GetHashCode() => Id?.GetHashCode() ?? 0;
}