public DebtDetailResponse ToDebtDetail(DynamicsGatewayOptions options) { return(new DebtDetailResponse { Id = Id, Amount = decimal.Parse(Amount), Reference = CreditorExternalReference, DebtTypeName = Type, NINO = NationalInsuranceNumber, CreatedOn = CreatedOn.ToDateTimeOffset(), ModifiedOn = ModifiedOn.ToDateTimeOffset(), Status = options.DebtStatus[StatusId.ToString()], SoldToCreditorName = ProposedCreditor?.Name, SoldToCreditorId = ProposedCreditor?.Id, PreviouslySold = PreviouslySold, CreditorName = Creditor.Name, CreditorId = Creditor.Id, StartsOn = CommencementDate?.ToDateTimeOffset(), EndsOn = ExpiryDate?.ToDateTimeOffset(), RemovedOn = RemovalDate?.ToDateTimeOffset(), DebtTypeId = TypeId, DebtEligibilityReview = DebtEligibilityReview != null ? DebtEligibilityReview.ToDebtEligibilityReview(options) : null, DebtRemovalReason = DebtRemovalReasonId.HasValue ? options.DebtRemovalReason.First(r => r.Value == DebtRemovalReasonId.ToString()).Key : (DebtRemovalReason?)null }); }
public override int GetHashCode() { int hashCode = IdVer.GetHashCode() + IdSubVer.GetHashCode() + Timestamp.GetHashCode() + (IdPrototype == null ? 0 : IdPrototype.GetHashCode()) + (IdItemBcn == null ? 0 : IdItemBcn.GetHashCode()) + (IdMatTypeL1 == null ? 0 : IdMatTypeL1.GetHashCode()) + (IdMatTypeL2 == null ? 0 : IdMatTypeL2.GetHashCode()) + (IdMatTypeL3 == null ? 0 : IdMatTypeL3.GetHashCode()) + (IdDefaultSupplier == null ? 0 : IdDefaultSupplier.GetHashCode()) + (IdModel == null ? 0 : IdModel.GetHashCode()) + (IdFamilyHK == null ? 0 : IdFamilyHK.GetHashCode()) + (IdColor1 == null ? 0 : IdColor1.GetHashCode()) + (IdColor2 == null ? 0 : IdColor2.GetHashCode()) + (IdItemHK == null ? 0 : IdItemHK.GetHashCode()) + (ItemDescription == null ? 0 : ItemDescription.GetHashCode()) + (Comments == null ? 0 : Comments.GetHashCode()) + (LaunchDate == null ? 0 : LaunchDate.GetHashCode()) + (RemovalDate == null ? 0 : RemovalDate.GetHashCode()) + IdStatusCial.GetHashCode() + IdStatusProd.GetHashCode() + (IdUserAttri1 == null ? 0 : IdUserAttri1.GetHashCode()) + (IdUserAttri2 == null ? 0 : IdUserAttri2.GetHashCode()) + (IdUserAttri3 == null ? 0 : IdUserAttri3.GetHashCode()) + (Unit == null ? 0 : Unit.GetHashCode()) + (DocsLink == null ? 0 : DocsLink.GetHashCode()) + CreateDate.GetHashCode() + (PhotoUrl == null ? 0 : PhotoUrl.GetHashCode()) + (User == null ? 0 : User.GetHashCode()); return(hashCode); }
/// <summary> /// Returns true if RunnerDefinition instances are equal /// </summary> /// <param name="other">Instance of RunnerDefinition to be compared</param> /// <returns>Boolean</returns> public bool Equals(RunnerDefinition other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) { return(false); } return((SortPriority == other.SortPriority || SortPriority != null && SortPriority.Equals(other.SortPriority)) && (RemovalDate == other.RemovalDate || RemovalDate != null && RemovalDate.Equals(other.RemovalDate)) && (Id == other.Id || Id != null && Id.Equals(other.Id)) && (Hc == other.Hc || Hc != null && Hc.Equals(other.Hc)) && (AdjustmentFactor == other.AdjustmentFactor || AdjustmentFactor != null && AdjustmentFactor.Equals(other.AdjustmentFactor)) && (Bsp == other.Bsp || Bsp != null && Bsp.Equals(other.Bsp)) && (Status == other.Status || Status != null && Status.Equals(other.Status))); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { var hash = 41; // Suitable nullity checks etc, of course :) if (SortPriority != null) { hash = hash * 59 + SortPriority.GetHashCode(); } if (RemovalDate != null) { hash = hash * 59 + RemovalDate.GetHashCode(); } if (Id != null) { hash = hash * 59 + Id.GetHashCode(); } if (Hc != null) { hash = hash * 59 + Hc.GetHashCode(); } if (AdjustmentFactor != null) { hash = hash * 59 + AdjustmentFactor.GetHashCode(); } if (Bsp != null) { hash = hash * 59 + Bsp.GetHashCode(); } if (Status != null) { hash = hash * 59 + Status.GetHashCode(); } return(hash); } }