var teacherName = string.Empty; var teachers = new List<(string Code, string TeacherName)>(); new List<(string Code, string StudentName, string TeacherName)>() .Where(t => !string.IsNullOrEmpty(teacherName) && teachers.Any(g => g.TeacherName == teacherName));
闲来无聊,预计是这么个意思,送一下代码。
明白了谢谢
var reslut=from a in Student;
if(TeacherName!=""){
result=from a in result
join b in Teacher.where(s=>s.TeacherName.equal("TeacherName")) on a.TeacherName equal b.TeacherName
select new { a,b };
}
差不多这样吧,好久没写啦
咳咳不可以这样写