public async Task <string> DeleteDirectory(string directoryId) { var directory = await GetDirectory(directoryId); if (directory != null) { fileWriter.DeleteDirectory(directory.Path); database.DirectoryRepository.Delete(directory); return(await database.Complete() ? directory.ParentDirectoryId ?? string.Empty : null); } Alertify.Push("Directory cannot be found", AlertType.Error); return(null); }