public void structUserInfo() { var studentInfoAll = _StudentInfoRepository.GetAll().ToList(); var facultystaff = _facultystaffInfoRepository.GetAll().ToList(); var schoolInsertList = _IMapper.Map <List <Student_Info>, List <User_Info> >(studentInfoAll); //需要插入的学校集合 var facultystafInfoInsertList = _IMapper.Map <List <facultystaff_Info>, List <User_Info> >(facultystaff); //需要插入的学校集合 _userInfoRepository.AddListBase(schoolInsertList); _userInfoRepository.AddListBase(facultystafInfoInsertList); _userInfoRepository.SaveChanges(); }