1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-06-02 07:11:44 +02:00
GiantsTools/Giants.DataContract/Contracts/V1/GiantsVersion.cs

40 lines
945 B
C#
Raw Normal View History

namespace Giants.DataContract
{
using System;
using System.ComponentModel.DataAnnotations;
public class GiantsVersion
{
[Required]
public int Build { get; set; }
[Required]
public int Major { get; set; }
[Required]
public int Minor { get; set; }
[Required]
public int Revision { get; set; }
public override bool Equals(object obj)
{
return obj is GiantsVersion info &&
Build == info.Build &&
Major == info.Major &&
Minor == info.Minor &&
Revision == info.Revision;
}
public override int GetHashCode()
{
return HashCode.Combine(Build, Major, Minor, Revision);
}
public Version ToVersion()
{
return new Version(this.Major, this.Minor, this.Build, this.Revision);
}
}
}