mirror of
https://github.com/ncblakely/GiantsTools
synced 2024-11-28 16:43:09 +01:00
34 lines
920 B
C#
34 lines
920 B
C#
namespace Giants.Services
|
|
{
|
|
using System;
|
|
|
|
public class ServerInfo : DataContract.ServerInfo, IIdentifiable
|
|
{
|
|
public string id => this.HostIpAddress;
|
|
|
|
public string DocumentType => nameof(ServerInfo);
|
|
|
|
public string HostIpAddress { get; set; }
|
|
|
|
public DateTime LastHeartbeat { get; set; }
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
return obj is ServerInfo info &&
|
|
base.Equals(obj) &&
|
|
this.HostIpAddress == info.HostIpAddress &&
|
|
this.DocumentType == info.DocumentType;
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
HashCode hash = new HashCode();
|
|
hash.Add(base.GetHashCode());
|
|
hash.Add(this.id);
|
|
hash.Add(this.HostIpAddress);
|
|
hash.Add(this.DocumentType);
|
|
return hash.ToHashCode();
|
|
}
|
|
}
|
|
}
|