Jaguar-dart / jaguar_orm

Source-generated ORM with relations (one-to-one, one-to-many, many-to-many), preloading, cascading, polymorphic relations, etc
https://jaguar-dart.github.io
BSD 3-Clause "New" or "Revised" License
217 stars 54 forks source link

Error when using findOneWhere() method #154

Closed jacksos101 closed 5 years ago

jacksos101 commented 5 years ago

I am trying to use the findOneWhere() method in bean.dart, and am using in the following manner:

myModelBean.findOneWhere((myModel) => myModel.shouldBeFound);

This works fine for the findWhere() method, but with findOneWhere() I am getting the following exception:

Unhandled Exception: type '(dynamic) => bool' is not a subtype of type 'Expression'
E/flutter (21687): 0      Bean.findOneWhere (package:jaguar_query/src/bean/bean.dart:70:36)

Am I passing the right argument to findOneWhere()?

Any advice would be much appreciated :)

jacksos101 commented 5 years ago

Ahhhh sorry, I'm confusing jaguar methods with dart iterable. My mistake..