/// <summary> /// 删除对象 /// </summary> /// <param name="bucket"></param> /// <param name="key"></param> /// <returns></returns> public async Task <OssResult <DeleteObjectResult> > DeleteObjectAsync(BucketInfo bucket, string key) { var cmd = new DeleteObjectCommand(_requestContext, bucket, key); var result = await cmd.ExecuteAsync(_client); if (!result.IsSuccess) { _logger.LogError($"Failed in OssClient.{nameof(PutObjectAsync)}(). \nBucket: {bucket.BucketName}\nPath: {key}"); } return(result); }
/// <summary> /// 删除对象 /// </summary> /// <param name="bucket"></param> /// <param name="key"></param> /// <returns></returns> public async Task <OssResult <DeleteObjectResult> > DeleteObjectAsync(BucketInfo bucket, string key) { var cmd = new DeleteObjectCommand(_requestContext, bucket, key); return(await cmd.ExecuteAsync()); }