Пример #1
0
    public async Task <IActionResult> DeleteAsync(string[] relativePaths)
    {
        var results = _uploadSvc.DeleteFiles(User, relativePaths);

        foreach (var result in results)
        {
            if (result.WasSuccessful)
            {
                await UploadHub.FileDeletedAsync(_uploadHub, User, result.UploadedFile);
            }
        }

        return(Ok(results));
    }
Пример #2
0
    public async Task <IEnumerable <FileOperationResult> > DeleteFilesAsync(List <string> files)
    {
        NullHelper.ThrowIfNull(Context.User);

        var results = _uploadSvc.DeleteFiles(Context.User, files);

        foreach (var result in results)
        {
            if (result.WasSuccessful)
            {
                await FileDeletedAsync(result.UploadedFile);
            }
        }

        return(results);
    }