コード例 #1
0
        public async Task <IResultModel> HardDelete(int id)
        {
            var entity = await _repository.GetAsync(id);

            if (entity == null)
            {
                return(ResultModel.Failed("文件不存在"));
            }

            var result = await _repository.DeleteAsync(id);

            if (result)
            {
                var fileObject = new FileObject
                {
                    ModuleCode = entity.ModuleCode,
                    Group      = entity.Group,
                    AccessMode = entity.AccessMode,
                    FileInfo   = FileEntity2FileInfo(entity)
                };

                await _fileStorageProvider.Delete(fileObject);
            }
            return(ResultModel.Result(result));
        }
コード例 #2
0
 /// <summary>
 /// Deletes the specified entity.
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <returns>Task.</returns>
 public virtual async Task Delete(FileStorageEntity entity)
 {
     await _provider.Delete(entity);
 }