deleteAll<_Model extends T> method
Delete every instance that matches query
in all providers. Return value reflects if
the operation completed without any failures.
Implementation
Future<bool> deleteAll<_Model extends T>({Query? query}) async {
final modelsToDelete = await get<_Model>(query: query);
var allDeletesSuccessful = true;
for (final model in modelsToDelete) {
final didDelete = await delete<_Model>(model, query: query);
if (!didDelete) allDeletesSuccessful = false;
}
return allDeletesSuccessful;
}