public async Task DeleteAsync(IDataFactory dataFactory, ICacheRepository cacheRepository, ItemDataModel itemDataModel) { var files = await dataFactory.ItemRepository.DownloadsAsync(itemDataModel.SiteId, itemDataModel.Id); foreach (var fileDataModel in files) { await dataFactory.DeleteFileAsync(fileDataModel.Id); } await dataFactory.DeleteAsync(itemDataModel); }