Adding a delete range and fixing show's editing

This commit is contained in:
Zoe Roux
2021-03-17 22:04:28 +01:00
parent 457dcd0db2
commit aac1975a75
7 changed files with 50 additions and 21 deletions
+7 -1
View File
@@ -218,7 +218,7 @@ namespace Kyoo.Controllers
}
public abstract Task Delete(T obj);
public virtual async Task DeleteRange(IEnumerable<T> objs)
{
foreach (T obj in objs)
@@ -236,5 +236,11 @@ namespace Kyoo.Controllers
foreach (string slug in slugs)
await Delete(slug);
}
public async Task DeleteRange(Expression<Func<T, bool>> where)
{
ICollection<T> resources = await GetAll(where);
await DeleteRange(resources);
}
}
}