public async Task Update(int id, UpdateStudentDto student) { var stud = _studentRepository .All() .Include(x => x.StudentCareers) .FirstOrDefault(x => x.Id == id); if (stud.Email != student.Email) { var studentBot = await _dataBotRepository.FirstOrDefault(x => x.Student.Id == id); if (studentBot != null) { await _dataBotRepository.Delete(studentBot); } } stud.Account = student.Account; stud.FirstName = student.FirstName; stud.SecondName = student.SecondName; stud.FirstSurname = student.FirstSurname; stud.SecondSurname = student.SecondSurname; stud.Settlement = student.Settlement; stud.Email = student.Email; await _studentRepository.Update(stud.StudentCareers, @student.Careers .Select(x => new StudentCareer() { CareerId = x, StudentId = id }), x => x.CareerId); }
public ActionResult <List <Student> > GetApplicant() { try { var student = _studentRepo.All(); return(Ok(student)); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, "Internal Server Error")); } }
public async Task <IActionResult> All() { try { var students = await _repository.All(); return(Ok(students)); } catch (Exception) { throw; } }
public List <Student> GetStudenten() { return(studentRepository.All().ToList <Student>()); }
public List <Student> All() { return(_studentRepository.All()); }
public List <Student> GetSQLStudents() { return(_studentRepository.All().ToList()); }