/// <summary> /// Indicates whether the current object is equal to another object of the same type. /// </summary> /// <param name="other">An object to compare with this object.</param> /// <returns>true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.</returns> public bool Equals(GpraNonResponseTypeDto <T> other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(base.Equals(other) && Equals(other._value, _value) && Equals(other._gpraNonResponse, _gpraNonResponse)); }
/// <summary> /// Compares the current object with another object of the same type. /// </summary> /// <param name="other">An object to compare with this object.</param> /// <returns>A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has the following meanings: /// Value /// Meaning /// Less than zero /// This object is less than the <paramref name="other"/> parameter. /// Zero /// This object is equal to <paramref name="other"/>. /// Greater than zero /// This object is greater than <paramref name="other"/>.</returns> public int CompareTo(GpraNonResponseTypeDto <T> other) { if (other == null) { return(1); } if (HasValue() && !other.HasValue()) { return(1); } if (!HasValue() && other.HasValue()) { return(-1); } if (!HasValue() && !other.HasValue()) { return(Comparer <LookupValueDto> .Default.Compare(GpraNonResponse, other.GpraNonResponse)); } return(CompareTo(other.Value)); }
/// <summary> /// Maps the type of to gpra non response. /// </summary> /// <typeparam name="T">The type of the value.</typeparam> /// <param name="gpraNonResponseTypeDto">The gpra non response type dto.</param> /// <param name="mappingHelper">The mapping helper.</param> /// <returns>A <see cref="Rem.Domain.Clinical.GpraModule.GpraNonResponseType<T>"/></returns> public static GpraNonResponseType <T> MapToGpraNonResponseType <T> ( GpraNonResponseTypeDto <T> gpraNonResponseTypeDto, IDtoToDomainMappingHelper mappingHelper) { var result = new GpraNonResponseType <T> (); if (gpraNonResponseTypeDto != null) { if (!typeof(T).IsNullable() || gpraNonResponseTypeDto.Value != null || gpraNonResponseTypeDto.GpraNonResponse != null) { result = gpraNonResponseTypeDto.GpraNonResponse != null ? new GpraNonResponseType <T> ( mappingHelper.MapLookupField <GpraNonResponse> (gpraNonResponseTypeDto.GpraNonResponse)) : new GpraNonResponseType <T> (gpraNonResponseTypeDto.Value); } } else { throw new InvalidOperationException("GpraNonResponseTypeDto Cannot be Null."); } return(result); }