diff --git a/lib/src/model/relationship/has_many.dart b/lib/src/model/relationship/has_many.dart index 79b8aa2d..510925d0 100644 --- a/lib/src/model/relationship/has_many.dart +++ b/lib/src/model/relationship/has_many.dart @@ -53,6 +53,11 @@ class HasMany> extends Relationship> { return _contains(element); } + bool containsId(Object id) { + final key = _adapter.core.getKeyForId(_internalType, id); + return _keys.contains(key); + } + /// Removes a [value] from this [Relationship] bool remove(E value) { return _remove(value);