public List <Group> getGroups() { GroupDBContext groupdb = new GroupDBContext(); List <Group> groups = groupdb.groups.ToList(); groupdb = null; return(groups); }
//查找某课程的group public List <Group> getGroups(string courseId) { GroupDBContext gdb = new GroupDBContext(); List <Group> gList = gdb.groups.ToList(); List <Group> result = new List <Group>(); foreach (Group g in gList) { if (g.courseId == courseId) { result.Add(g); } } return(result); }