You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/ZeroLevel/Services/Network/Model/ServiceEndpointInfo.cs

44 lines
1.1 KiB

6 years ago
using System;
using ZeroLevel.Services.Serialization;
6 years ago
namespace ZeroLevel.Network
6 years ago
{
/// <summary>
6 years ago
/// Endpoint
6 years ago
/// </summary>
public class ServiceEndpointInfo :
6 years ago
IEquatable<ServiceEndpointInfo>
6 years ago
{
6 years ago
public string Key { get; set; }
public string Type { get; set; }
public string Group { get; set; }
6 years ago
public string Endpoint { get; set; }
public bool Equals(ServiceEndpointInfo other)
{
if (other == null) return false;
if (string.Compare(this.Endpoint, other.Endpoint, true) != 0) return false;
return true;
}
public override bool Equals(object obj)
{
return this.Equals(obj as ServiceEndpointInfo);
}
public override int GetHashCode()
{
6 years ago
return Endpoint?.GetHashCode() ?? 0;
6 years ago
}
public void Serialize(IBinaryWriter writer)
{
writer.WriteString(this.Endpoint);
}
public void Deserialize(IBinaryReader reader)
{
this.Endpoint = reader.ReadString();
}
6 years ago
}
}

Powered by TurnKey Linux.