public StudentServices(DataContext dataContext, IClassroomServices classroomServices, IMapper mapper) { DataContext = dataContext; IClassroomServices = classroomServices; Mapper = mapper; }
public ClassroomController(IClassroomServices classroomServices) { ClassroomServices = classroomServices; }
public void UpdateStudent(Student student) { student.Classroom = IClassroomServices.GetClassroomByID(student.ClassroomID); DataContext.Students.Update(student); DataContext.SaveChanges(); }