/// <summary> ///获得多个数据到St扩展属性udens类的 /// </summary> /// <param name="classId"></param> /// <returns></returns> public List<Students> GetStuList(int classId) { //根据ClassId从StudentClass中取ClassName,并给Student类中的扩展属性ClassName return Db.Queryable<Students, StudentClass>((stu, stuClass) => new object[] { JoinType.Inner, stu.ClassId == stuClass.ClassId }) .Where(stu => stu.ClassId == classId).Select((stu,stuClass)=>new Students() {StudentName=stu.StudentName.SelectAll(), ClassName=stuClass.ClassName }).ToList(); }