コード例 #1
0
        public List <Group> getGroups()
        {
            GroupDBContext groupdb = new GroupDBContext();
            List <Group>   groups  = groupdb.groups.ToList();

            groupdb = null;
            return(groups);
        }
コード例 #2
0
        //查找某课程的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);
        }