public void Main() { StudentBO studentBusinessObject = new StudentBO(); //输出所有的学生 for (int i = 0; i < studentBusinessObject.GetAllStudent().Count; i++) { Console.WriteLine("Name:" + studentBusinessObject.GetAllStudent()[i].GetName() + "RollNo:" + studentBusinessObject.GetAllStudent()[i].GetRollNo()); } //更新学生 StudentVO student = studentBusinessObject.GetAllStudent()[0]; student.SetName("Michael"); studentBusinessObject.UpdateStudent(student); //获取学生 student = studentBusinessObject.GetStudent(0); Console.WriteLine("Name:" + student.GetName() + "RollNo:" + student.GetRollNo()); }
// GET: api/Students/5 public Student Get(int Id) { return(StudentBO.GetStudent(Id)); }