2020-08-16 11:03:10 +02:00
|
|
|
|
namespace Giants.DataContract.V1
|
2020-08-09 11:10:33 +02:00
|
|
|
|
{
|
|
|
|
|
using System;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
|
2020-08-11 10:29:45 +02:00
|
|
|
|
public class AppVersion
|
2020-08-09 11:10:33 +02:00
|
|
|
|
{
|
|
|
|
|
[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)
|
|
|
|
|
{
|
2020-08-11 10:29:45 +02:00
|
|
|
|
return obj is AppVersion info &&
|
2020-08-09 11:10:33 +02:00
|
|
|
|
Build == info.Build &&
|
|
|
|
|
Major == info.Major &&
|
|
|
|
|
Minor == info.Minor &&
|
|
|
|
|
Revision == info.Revision;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return HashCode.Combine(Build, Major, Minor, Revision);
|
|
|
|
|
}
|
2020-08-10 09:22:33 +02:00
|
|
|
|
|
|
|
|
|
public Version ToVersion()
|
|
|
|
|
{
|
|
|
|
|
return new Version(this.Major, this.Minor, this.Build, this.Revision);
|
|
|
|
|
}
|
2020-08-09 11:10:33 +02:00
|
|
|
|
}
|
|
|
|
|
}
|