Beispiel #1
0
        public async Task <JsonResult> RemoveAsync(IEnumerable <FullPath> paths)
        {
            var response = new RemoveResponseModel();

            foreach (var path in paths)
            {
                await RemoveThumbsAsync(path);

                if (path.IsDirectory && await path.Directory.ExistsAsync)
                {
                    await AzureBlobStorageApi.DeleteDirectoryAsync(path.Directory.FullName);
                }
                else if (await path.File.ExistsAsync)
                {
                    await AzureBlobStorageApi.DeleteFileAsync(path.File.FullName);
                }

                response.Removed.Add(path.HashedTarget);
            }

            return(await Json(response));
        }
Beispiel #2
0
 public Task DeleteAsync()
 {
     return(AzureBlobStorageApi.DeleteFileAsync(BlobItemName));
 }