示例#1
0
 /// <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(DensAsiNonResponseTypeDto <T> other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(base.Equals(other) && Equals(other._value, _value) && Equals(other._densAsiNonResponse, _densAsiNonResponse));
 }
示例#2
0
 /// <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(DensAsiNonResponseTypeDto <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(DensAsiNonResponse, other.DensAsiNonResponse));
     }
     return(CompareTo(other.Value));
 }
        /// <summary>
        /// Maps the type of to dens asi non response.
        /// </summary>
        /// <typeparam name="T">The type of the value.</typeparam>
        /// <param name="densAsiNonResponseTypeDto">The dens asi non response type dto.</param>
        /// <param name="mappingHelper">The mapping helper.</param>
        /// <returns>A <see cref="Rem.Domain.Clinical.DensAsiModule.DensAsiNonResponseType&lt;T&gt;"/></returns>
        public static DensAsiNonResponseType <T> MapToDensAsiNonResponseType <T> (
            DensAsiNonResponseTypeDto <T> densAsiNonResponseTypeDto, IDtoToDomainMappingHelper mappingHelper)
        {
            var result = new DensAsiNonResponseType <T> ();

            if (densAsiNonResponseTypeDto != null)
            {
                if (!typeof(T).IsNullable() || densAsiNonResponseTypeDto.Value != null || densAsiNonResponseTypeDto.DensAsiNonResponse != null)
                {
                    result = densAsiNonResponseTypeDto.DensAsiNonResponse != null
                                 ? new DensAsiNonResponseType <T> (
                        mappingHelper.MapLookupField <DensAsiNonResponse> (densAsiNonResponseTypeDto.DensAsiNonResponse))
                                 : new DensAsiNonResponseType <T> (densAsiNonResponseTypeDto.Value);
                }
            }
            else
            {
                throw new InvalidOperationException("DensAsiNonResponseTypeDto Cannot be Null.");
            }

            return(result);
        }