예제 #1
0
        public bool EraseFile(File fileInDb)
        {
            var res = _awsS3Service.DeleteFile(fileInDb.PathName, fileInDb.AwsRegion, !string.IsNullOrWhiteSpace(fileInDb.ThumbUrl));

            if (!string.IsNullOrWhiteSpace(res))
            {
                return(false);
            }

            return(true);
        }
        public async Task <BaseResponse <DeleteObjectResponse> > DeleteByIdFromS3(int id)
        {
            var fileS3 = _fileS3Repository.GetById(id);

            var response = await _awsS3Service.DeleteFile(fileS3.FilePath);

            return(new BaseResponse <DeleteObjectResponse>
            {
                Data = response,
                StatusCode = response.HttpStatusCode
            });
        }