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
In C# 7 you can do this:
C# 7
public override int GetHashCode() => (Start, End).GetHashCode();
The ValueTuple is available in .NET Framework 4.7 and .NET Core, or via NuGet.
ValueTuple
.NET Framework 4.7
.NET Core
Not sure how well it performs, but I would be surprised if any custom code would beat it.