I want to use a date range (from one date to another date) as a key for a dictionary, so I wrote my own struct:
struct DateRange { public DateTime St
You can use the method from Effective Java as Jon Skeet shows here. For your specific type:
public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hash = 17; hash = hash * 23 + Start.GetHashCode(); hash = hash * 23 + End.GetHashCode(); return hash; } }