exists<TModel extends TRepositoryModel> method
Check if a TModel
is accessible locally.
First checks if there's a matching query in memoryCacheProvider and then check sqliteProvider.
Does not query remoteProvider.
Implementation
Future<bool> exists<TModel extends TRepositoryModel>({
Query? query,
}) async {
if (memoryCacheProvider.canFind<TModel>(query)) {
final results = memoryCacheProvider.get<TModel>(query: query, repository: this);
if (results?.isNotEmpty ?? false) return true;
}
return await sqliteProvider.exists<TModel>(query: query, repository: this);
}