public async Task <LecturerModuleGroup> AddLecturerModuleGroup(LecturerModuleGroup lecturerModuleGroup) { var result = await context.LecturerModuleGroups.AddAsync(lecturerModuleGroup); await context.SaveChangesAsync(); return(result.Entity); }
public async Task <LecturerModuleGroup?> UpdateLecturerModuleGroup(LecturerModuleGroup lecturerModuleGroup) { var result = await GetLecturerModuleGroup(lecturerModuleGroup.LecturerId); if (result != null) { result.Lecturer = lecturerModuleGroup.Lecturer; result.ModuleGroup = lecturerModuleGroup.ModuleGroup; await context.SaveChangesAsync(); return(result); } return(null); }