public static CauHinhDoKhoDTO FromEntity(CauHinhDoKho item) { return(new CauHinhDoKhoDTO() { Id = item.Id, DeThiId = item.DeThiId, MucDoId = item.MucDoId, SoLuongCauHoi = item.SoLuongCauHoi, Diem = item.Diem, DaoDapAn = item.DaoDapAn, DeThi = item.DeThi != null?DeThiDTO.FromEntity(item.DeThi) : null, MucDo = item.MucDo != null?MucDoDTO.FromEntity(item.MucDo) : null, }); }
public static CauHoiDTO FromEntity(CauHoi item) { return(new CauHoiDTO() { Id = item.Id, TenCauHoi = item.TenCauHoi, KyHieu = item.KyHieu, MoTa = item.MoTa, TienTo = item.TienTo, HauTo = item.HauTo, DangCauHoiId = item.DangCauHoiId, KhoCauHoiId = item.KhoCauHoiId, MucDoId = item.MucDoId, GiaTriDapAn = item.GiaTriDapAn, DangCauHoi = item.DangCauHoi != null?DangCauHoiDTO.FromEntity(item.DangCauHoi) : null, KhoCauHoi = item.KhoCauHoi != null?KhoCauHoiDTO.FromEntity(item.KhoCauHoi) : null, MucDo = item.MucDo != null?MucDoDTO.FromEntity(item.MucDo) : null, DapAnCauHoi = item.DapAnCauHoi?.Select(DapAnCauHoiDTO.FromEntity), }); }