public static DoctorViewModel ToDoctorViewModel(this MEDoctor entity)
        {
            if (entity == null)
            {
                return(null);
            }

            DoctorViewModel dto = new DoctorViewModel();

            dto.CopyPropertiesFrom(entity);
            dto.MEDoctorID = entity.MEDoctorID;
            return(dto);
        }
        public static DoctorViewModel ToDoctorViewModel(this MEDoctorSpecialist entity, SpecialistViewModel[] specialists)
        {
            if (entity.MEDoctor == null)
            {
                return(null);
            }

            DoctorViewModel dto = new DoctorViewModel();

            dto.CopyPropertiesFrom(entity.MEDoctor);
            dto.MEDoctorID  = entity.MEDoctor.MEDoctorID;
            dto.Specialists = specialists;
            return(dto);
        }
        public static DoctorViewModel ToDoctorViewModel(this MEDoctor entity, SpecialistViewModel[] specialists)
        {
            if (entity == null)
            {
                return(null);
            }

            DoctorViewModel dto = new DoctorViewModel();

            dto.CopyPropertiesFrom(entity);
            dto.MEDoctorID      = entity.MEDoctorID;
            dto.Specialists     = specialists;
            dto.MESpecialistIds = specialists.Select(x => x.MESpecialistID.ToString()).ToArray();
            return(dto);
        }