firstWhereOrNull method
Future<TEntity?>
firstWhereOrNull({
- Iterable<
ColumnDefinition< ? columns(IEntity, dynamic> >- TMeta t
- List<
OrmOrder> ? orderBy(- TMeta t
- required Filter where(
- TMeta t
- int? offset,
- bool? useIsolate,
- Map<
String, dynamic> ? isolateArgs, - void onIsolatePreMap()?,
inherited
Implementation
@override
Future<TEntity?> firstWhereOrNull({
Iterable<ColumnDefinition>? Function(TMeta t)? columns,
List<OrmOrder>? Function(TMeta t)? orderBy,
required Filter Function(TMeta t) where,
int? offset,
final bool? useIsolate,
Map<String, dynamic>? isolateArgs,
void Function(Map<String, dynamic>? isolateArgs)? onIsolatePreMap,
}) async {
List<TEntity> maps = await query(
where: where,
columns: columns ?? (t) => t.columns,
limit: 1,
offset: offset,
orderBy: orderBy,
useIsolate: useIsolate,
isolateArgs: isolateArgs,
onIsolatePreMap: onIsolatePreMap,
);
if (maps.isNotEmpty) {
return maps.first;
}
return null;
}