var resultt = from c in ent.Student where c.Name.Contains("王") select new { c.Name, c.Sex, c.StudentId }; var data = ent.Student.Select(p => new { p.Name, p.E_mail, p.ClassId }).Where(p => p.Name.Contains("王"));怎么用这样:List<Student>resultt =( from c in ent.Student where c.Name.Contains("王") select new { c.Name, c.Sex, c.StudentId }).ToList(); List<Student>data = ent.Student.Select(p => new { p.Name, p.E_mail, p.ClassId }).Where(p => p.Name.Contains("王")).ToList();但是用了匿名类报错
1 回答
- 1 回答
- 0 关注
- 1025 浏览
添加回答
举报
0/150
提交
取消