public StringModel ToStringModel <BLModel, StringModel>() { Mapper.CreateMap <OrderExport, StringOrderExport>() .ForAllMembers(item => item.ToString().CutDownTo(50)); var stringModel = Mapper.Map <OrderExport, StringOrderExport>(this); stringModel.UnitCost = UnitCost.DecimalToString(2); stringModel.ExportDate = ExportDate.DateTimeToString(); stringModel.ItemDescription = ItemDescription.CutDownTo(50); stringModel.LeadTime = LeadTime.DecimalToString(2); stringModel.EstimateOfDemand = EstimateOfDemand.DecimalToString(2); stringModel.Returnable = Returnable.CutDownTo(1); stringModel.Stocked = Stocked.CutDownTo(1); stringModel.Hazardous = Hazardous.CutDownTo(1); stringModel.DueDate = DueDate.DateTimeToString(); Mapper.CreateMap <StringOrderExport, StringModel>(); var stringModelRet = Mapper.Map <StringOrderExport, StringModel>(stringModel); return(stringModelRet); }
/// <summary> /// Returns true if DetailedSegment instances are equal /// </summary> /// <param name="other">Instance of DetailedSegment to be compared</param> /// <returns>Boolean</returns> public bool Equals(DetailedSegment other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( CreatedAt == other.CreatedAt || CreatedAt != null && CreatedAt.Equals(other.CreatedAt) ) && ( UpdatedAt == other.UpdatedAt || UpdatedAt != null && UpdatedAt.Equals(other.UpdatedAt) ) && ( TotalElevationGain == other.TotalElevationGain || TotalElevationGain != null && TotalElevationGain.Equals(other.TotalElevationGain) ) && ( Map == other.Map || Map != null && Map.Equals(other.Map) ) && ( EffortCount == other.EffortCount || EffortCount != null && EffortCount.Equals(other.EffortCount) ) && ( AthleteCount == other.AthleteCount || AthleteCount != null && AthleteCount.Equals(other.AthleteCount) ) && ( Hazardous == other.Hazardous || Hazardous != null && Hazardous.Equals(other.Hazardous) ) && ( StarCount == other.StarCount || StarCount != null && StarCount.Equals(other.StarCount) )); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (CreatedAt != null) { hashCode = hashCode * 59 + CreatedAt.GetHashCode(); } if (UpdatedAt != null) { hashCode = hashCode * 59 + UpdatedAt.GetHashCode(); } if (TotalElevationGain != null) { hashCode = hashCode * 59 + TotalElevationGain.GetHashCode(); } if (Map != null) { hashCode = hashCode * 59 + Map.GetHashCode(); } if (EffortCount != null) { hashCode = hashCode * 59 + EffortCount.GetHashCode(); } if (AthleteCount != null) { hashCode = hashCode * 59 + AthleteCount.GetHashCode(); } if (Hazardous != null) { hashCode = hashCode * 59 + Hazardous.GetHashCode(); } if (StarCount != null) { hashCode = hashCode * 59 + StarCount.GetHashCode(); } return(hashCode); } }