first method

Future<T> first()

Execute and get first result (throws if not found)

Implementation

Future<T> first() async {
  final result = await firstOrDefault();
  if (result == null) {
    throw Exception('No matching record found');
  }
  return result;
}