public async Task DeleteTeamAsync(int id) { await matchService.DeleteMatchesRelatedToTheTeamAsync(id); var teamToDelete = await teamRepository.GetByIdAsync(id) ?? throw new NotFoundInDatabaseException();; teamRepository.Delete(teamToDelete); await unitOfWork.CompleteAsync(); }