// Add student public async Task <Student> AddStudentAsync(Student student) { try { dbContext.Students.Add(student); await dbContext.SaveChangesAsync(); } catch (Exception) { throw; } return(student); }
// Add SchoolClass public async Task <SchoolClass> AddSchoolClassAsync(SchoolClass schoolClass) { try { dbContext.SchoolClasses.Add(schoolClass); await dbContext.SaveChangesAsync(); } catch (Exception) { throw; } return(schoolClass); }
// Add student public async Task <Teacher> AddTeacherAsync(Teacher teacher) { try { dbContext.Teachers.Add(teacher); await dbContext.SaveChangesAsync(); } catch (Exception) { throw; } return(teacher); }