findOrFail method
Finds a model by primary key or throws if not found.
Implementation
Future<T> findOrFail(dynamic id) async {
final model = await find(id);
if (model == null) {
throw StateError('$T with id $id not found');
}
return model;
}