Implemented unique Id for each entry - Implemented delete single entry command

This commit is contained in:
2025-02-04 13:56:40 +03:30
parent 83347587e4
commit 9b1d6aebe7
6 changed files with 194 additions and 175 deletions

View File

@@ -66,9 +66,9 @@ namespace TBDel.Services
return await Task.FromResult(_folderCollection.ToList());
}
public async Task<bool> RemoveFileEntryAsync(string path)
public async Task<bool> RemoveFileEntryAsync(uint id)
{
var entryToRemove = _fileCollection.FirstOrDefault(e => e.Path == path);
var entryToRemove = _fileCollection.FirstOrDefault(e => e.Id == id);
if (entryToRemove != null)
{
_fileCollection.Remove(entryToRemove);
@@ -78,9 +78,9 @@ namespace TBDel.Services
return await Task.FromResult(false);
}
public async Task<bool> RemoveFolderEntryAsync(string path)
public async Task<bool> RemoveFolderEntryAsync(uint id)
{
var entryToRemove = _folderCollection.FirstOrDefault(e => e.Path == path);
var entryToRemove = _folderCollection.FirstOrDefault(e => e.Id == id);
if (entryToRemove != null)
{
_folderCollection.Remove(entryToRemove);
@@ -89,6 +89,8 @@ namespace TBDel.Services
}
return await Task.FromResult(false);
}
}
public class DatabaseContent