refactor IFileService. Rename DeletedAsync method to DeleteAsync

This commit is contained in:
Фролов 2021-10-06 18:07:35 +05:00
parent 1a36609d19
commit 4cec602678
4 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ namespace AsbCloudApp.Services
Task<int> MarkAsDeletedAsync(int idFile,
CancellationToken token = default);
Task<IEnumerable<FileInfoDto>> GetInfosByCategoryAsync(int idWell, int idCategory, CancellationToken token = default);
Task<int> DeletedAsync(int id, CancellationToken token);
Task<int> DeleteAsync(int id, CancellationToken token);
string GetUrl(FileInfoDto fileInfo);
string GetUrl(int idFile);
string GetUrl(int idWell, int idCategory, int idFile, string dotExtention);

View File

@ -43,13 +43,13 @@ namespace AsbCloudInfrastructure.Services
matchFilesIterator.MoveNext();
var matchFile = matchFilesIterator.Current;
while (matchFilesIterator.MoveNext())
await fileService.DeletedAsync(matchFilesIterator.Current.Id, token)
await fileService.DeleteAsync(matchFilesIterator.Current.Id, token)
.ConfigureAwait(false);
if (filesInfos.All(f => f.UploadDate <= matchFile.UploadDate))
return matchFile;
else
await fileService.DeletedAsync(matchFile.Id, token)
await fileService.DeleteAsync(matchFile.Id, token)
.ConfigureAwait(false);
}

View File

@ -41,13 +41,13 @@ namespace AsbCloudInfrastructure.Services
matchFilesIterator.MoveNext();
var matchFile = matchFilesIterator.Current;
while (matchFilesIterator.MoveNext())
await fileService.DeletedAsync(matchFilesIterator.Current.Id, token)
await fileService.DeleteAsync(matchFilesIterator.Current.Id, token)
.ConfigureAwait(false);
if (filesInfos.All(f => f.UploadDate <= matchFile.UploadDate))
return matchFile;
else
await fileService.DeletedAsync(matchFile.Id, token)
await fileService.DeleteAsync(matchFile.Id, token)
.ConfigureAwait(false);
}

View File

@ -191,7 +191,7 @@ namespace AsbCloudInfrastructure.Services
return await db.SaveChangesAsync(token).ConfigureAwait(false);
}
public async Task<int> DeletedAsync(int idFile, CancellationToken token)
public async Task<int> DeleteAsync(int idFile, CancellationToken token)
{
var fileInfo = await db.Files
.FirstOrDefaultAsync(f => f.Id == idFile, token)