diff --git a/Interfaces/IXBaseFileProvider.cs b/Interfaces/IXBaseFileProvider.cs
index e2343fc..7f80968 100644
--- a/Interfaces/IXBaseFileProvider.cs
+++ b/Interfaces/IXBaseFileProvider.cs
@@ -77,7 +77,7 @@ namespace xFileService.Interfaces
///
///
///
- Task> RemoveFile(
+ Task> RemoveFiles(
TKey forProvidedId,
string ids = null,
string connectionId = null,
diff --git a/Providers/XBaseFileProvider.cs b/Providers/XBaseFileProvider.cs
index 086d8be..4b54dc0 100644
--- a/Providers/XBaseFileProvider.cs
+++ b/Providers/XBaseFileProvider.cs
@@ -246,11 +246,11 @@ namespace xFileService.Providers
/// Remove Specified Files ...
///
///
- ///
+ /// if null, Remove all Files
///
///
///
- public async Task> RemoveFile(
+ public async Task> RemoveFiles(
TKey providedForId,
string ids = null,
string connectionId = null,
@@ -274,14 +274,26 @@ namespace xFileService.Providers
idsList = ids
.ParseListGuid()
.ToList();
+ }
+ else
+ {
+ //
+ var identifier = GetProvidedID(providedForId);
+ //
+ // Select All Referenced Files ...
+ idsList = FileProvider.FileRepository
+ .AsQueryable()
+ .Where(f => f.References.Contains(identifier))
+ .Select(f => f.Id)
+ .ToList();
}
//
// Retrieve Entities ...
entities = FileProvider.FileRepository
.AsQueryable()
- .Where(d => !idsList.Contains(d.Id) &&
+ .Where(d => idsList.Contains(d.Id) &&
d.References.Contains(Provider));
//