public static SpecialistViewModel ToSpecialistViewModel(this MEDoctorSpecialist entity) { if (entity.MESpecialist == null) { return(null); } SpecialistViewModel dto = new SpecialistViewModel(); dto.CopyPropertiesFrom(entity.MESpecialist); dto.MESpecialistID = entity.MESpecialist.MESpecialistID; 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); }