public async Task <bool> DeleteProfessorAsync(int professorId) { var professor = (await professorRepository.GetProfessorByIdAsync(professorId)); if (professor == null) { throw new KeyNotFoundException(); } await professorRepository.DeleteAsync(professor); return((await context.SaveChangesAsync()) > 0); }
public async Task DeleteAsync(int id) { await _professorRepository.DeleteAsync(id); }
public async Task DeleteAsync(Professor professor) { await _blobService.DeleteAsync(professor.ImageUri); await _professorRepository.DeleteAsync(professor.Id); }