Beispiel #1
0
        private static bool Compare(MeetingGetDto m1, MeetingGetDto m2)
        {
            if (m1 is null)
            {
                return(false);
            }
            if (m2 is null)
            {
                return(false);
            }
            if (m1.Id != m2.Id)
            {
                return(false);
            }
            if (m1.EventType != m2.EventType)
            {
                return(false);
            }
            if (m1.Name != m2.Name)
            {
                return(false);
            }
            if (m1.CreationDate != m2.CreationDate)
            {
                return(false);
            }
            if (m1.ExpiryDate != m2.ExpiryDate)
            {
                return(false);
            }
            if (m1.Description != m2.Description)
            {
                return(false);
            }
            if (m1.AuthorId != m2.AuthorId)
            {
                return(false);
            }
            if (m1.MaxNumberOfParticipants != m2.MaxNumberOfParticipants)
            {
                return(false);
            }

            if (m1.Participants is null && m2.Participants is null)
            {
                return(true);
            }
            if (m1.Participants is null ^ m2.Participants is null)
            {
                return(false);
            }
            var firstNotSecond = m1.Participants.Except(m2.Participants).ToList();
            var secondNotFirst = m2.Participants.Except(m1.Participants).ToList();

            if (firstNotSecond.Any() || secondNotFirst.Any())
            {
                return(false);
            }
            return(true);
        }
Beispiel #2
0
 private static bool CompareWithDto(MeetingGetDto m, MeetingDto dto)
 {
     if (m is null)
     {
         return(false);
     }
     if (dto is null)
     {
         return(false);
     }
     if (m.Name != dto.Name)
     {
         return(false);
     }
     if (m.ExpiryDate != dto.ExpiryDate)
     {
         return(false);
     }
     if (m.Description != dto.Description)
     {
         return(false);
     }
     if (m.Description != dto.Description)
     {
         return(false);
     }
     if (m.MaxNumberOfParticipants != dto.MaxNumberOfParticipants)
     {
         return(false);
     }
     return(true);
 }