public async Task <IList <VcMentorMapping> > GetMentorListAsync(string baSn) { IEnumerable <VcMentorMapping> listMentorTask = null; var convertBaSn = int.Parse(baSn); listMentorTask = await scMentorMappingRepository.GetMentorMappingsAsync(mmp => mmp.BaSn == convertBaSn); return(listMentorTask.ToList()); }
public async Task <IList <ScMentorMappiing> > GetMentorListAsync(int mngCompSn, int bizWorkSn = 0, string usrTypeDetail = null) { IEnumerable <ScMentorMappiing> listMentorTask = null; if (bizWorkSn == 0 && string.IsNullOrEmpty(usrTypeDetail)) { listMentorTask = await scMentorMappingRepository.GetMentorMappingsAsync( mmp => mmp.Status == "N" && mmp.ScUsr.UsrType == "M" && mmp.MngCompSn == mngCompSn); } else if (bizWorkSn != 0 && string.IsNullOrEmpty(usrTypeDetail)) { listMentorTask = await scMentorMappingRepository.GetMentorMappingsAsync( mmp => mmp.Status == "N" && mmp.ScUsr.UsrType == "M" && mmp.MngCompSn == mngCompSn && mmp.BizWorkSn == bizWorkSn); } else if (bizWorkSn == 0 && !string.IsNullOrEmpty(usrTypeDetail)) { listMentorTask = await scMentorMappingRepository.GetMentorMappingsAsync( mmp => mmp.Status == "N" && mmp.ScUsr.UsrType == "M" && mmp.MngCompSn == mngCompSn && mmp.ScUsr.UsrTypeDetail == usrTypeDetail); } else { listMentorTask = await scMentorMappingRepository.GetMentorMappingsAsync( mmp => mmp.Status == "N" && mmp.ScUsr.UsrType == "M" && mmp.MngCompSn == mngCompSn && mmp.BizWorkSn == bizWorkSn && mmp.ScUsr.UsrTypeDetail == usrTypeDetail); } return(listMentorTask.OrderByDescending(mmp => mmp.RegDt).ToList()); }