Refactor IPAM model classes to use records for Address, Subnetwork, Vlan, Vrf, Section, Tag, Domain, Nameserver, and Session; enhance documentation and implement value equality for records.
This commit is contained in:
@@ -1,27 +1,17 @@
|
||||
namespace PS.IPAM;
|
||||
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an L2 domain in phpIPAM.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class Domain {
|
||||
public int Id { get; }
|
||||
public string Name { get; }
|
||||
public string Description { get; }
|
||||
public string Sections { get; }
|
||||
|
||||
public Domain (
|
||||
int id,
|
||||
string name,
|
||||
string description,
|
||||
string sections
|
||||
) {
|
||||
this.Id = id;
|
||||
this.Name = name;
|
||||
this.Description = description;
|
||||
this.Sections = sections;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return this.Name;
|
||||
}
|
||||
}
|
||||
public sealed record Domain(
|
||||
int Id,
|
||||
string Name,
|
||||
string Description,
|
||||
string Sections
|
||||
)
|
||||
{
|
||||
public override string ToString() => Name;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user