public static EntityMapped ReadFromDTO(EntityMapped target, EntityMappedDTO source)
 {
     target.EntityId = source.EntityId;
     ReadAddressesFromDTO(target.Entity.Addresses, source.Addresses);
     ReadContactDetailsFromDTO(target.Entity.ContactDetails, source.ContactDetails);
     target.ModifiedDate = source.ModifiedDate;
     return(target);
 }
 public static EntityMappedDTO WriteToDTO(EntityMapped source)
 {
     return(new EntityMappedDTO
     {
         EntityId = source.EntityId,
         Addresses = source.Entity.Addresses.Select(EntityAddressTX.WriteToDTO).ToArray(),
         ContactDetails = source.Entity.ContactDetails.Select(EntityContactTX.WriteToDTO).ToArray(),
         ModifiedDate = source.ModifiedDate,
     });
 }
        public static int Compare(EntityMapped lhs, EntityMappedDTO rhs)
        {
            if (ReferenceEquals(lhs, null))
            {
                return(-1);
            }

            if (ReferenceEquals(rhs, null))
            {
                return(1);
            }

            return(lhs.EntityId.CompareTo(lhs.EntityId));
        }
 public static int Compare(EntityMappedDTO lhs, EntityMapped rhs)
 {
     return(Compare(rhs, lhs) * -1);
 }