public override int GetHashCode() { unchecked { var hashCode = _hashCode; hashCode = (hashCode * 397) ^ FullKey.GetHashCode(); hashCode = (hashCode * 397) ^ (LoadtypeGuid != null ? LoadtypeGuid.GetHashCode() : 0); hashCode = (hashCode * 397) ^ DeviceCategory.GetHashCode(); hashCode = (hashCode * 397) ^ LocationGuid.GetHashCode(); hashCode = (hashCode * 397) ^ DeviceGuid.GetHashCode(); hashCode = (hashCode * 397) ^ HouseholdKey.GetHashCode(); hashCode = (hashCode * 397) ^ (int)ThisDeviceType; return(hashCode); } }
public OefcKey([NotNull] CalcDeviceDto dto, StrGuid loadtypeGuid) { HouseholdKey = dto.HouseholdKey; ThisDeviceType = dto.DeviceType; DeviceGuid = dto.Guid; LocationGuid = dto.LocationGuid; LoadtypeGuid = loadtypeGuid; DeviceCategory = dto.DeviceCategoryName; unchecked { _hashCode = LocationGuid.GetHashCode(); if (loadtypeGuid != null) { _hashCode = (_hashCode * 397) ^ loadtypeGuid.GetHashCode(); } _hashCode = (_hashCode * 397) ^ DeviceGuid.GetHashCode(); _hashCode = (_hashCode * 397) ^ HouseholdKey.Key.GetHashCode(); _hashCode = (_hashCode * 397) ^ (int)ThisDeviceType; } //needed for the makekey due to compiler error FullKey = ""; FullKey = MakeKey(); }