I have a model that I want to add as an Asymetric Object.
I declare it as
@RealmModel(ObjectType.asymmetricObject)
class _MyModel {
@PrimaryKey()
@MapTo('_id')
late ObjectId id;
}
When I write the code to attempt to write it…
await realm.writeAsync(() => realm.add(myObject));
… I get a compiler error…
MyModel' doesn't conform to the bound 'RealmObject' of the type parameter 'T'.
Try using a type that is or is a subclass of 'RealmObject'.
When I look at the .g.dart file for the model I see that it is (correctly I think) generated as an AsymetricObject and not a RealmObject.
class MyModel extends _RealmFileRecordLinkChunk
with RealmEntity, RealmObjectBase, AsymmetricObject {
Models that I do not have marked as asymmetric have RealmObject instead of AsymmetricObject.
The .NET client works great w/ AsymmetricObjects… what’s up w/ the Dart SDK?
rjsjr