using System; namespace BO.AppServer.Data { public class KeyScalarDate : IEquatable { public int Day { get; set; } public int Month { get; set; } public int Year { get; set; } public bool Equals(KeyScalarDate other) { if (other == null) return false; return Day == other.Day && Year == other.Year && Month == other.Month; } public override bool Equals(object obj) { if (ReferenceEquals(null, obj)) return false; if (ReferenceEquals(this, obj)) return true; if (obj.GetType() != this.GetType()) return false; return Equals((KeyScalarDate)obj); } public override int GetHashCode() { return (Day * Month * Year).GetHashCode(); } public static bool operator ==(KeyScalarDate left, KeyScalarDate right) { return Equals(left, right); } public static bool operator !=(KeyScalarDate left, KeyScalarDate right) { return !Equals(left, right); } } }