In this topic:
There is following note:
Primary keys can be of type char, short, int, long, string, or MongoDB.Bson.ObjectId. Once you assign a property as a primary key, you cannot change it after an object of that type is added to a realm.
But, I get the following when I set my primary ket to a MongoDB.Bson.ObjectId:
Severity Code Description Project File Line Suppression State
Error Fody/Realm: Item.ID is marked as [PrimaryKey] which is only allowed on integral and string types, not on MongoDB.Bson.ObjectId. StretchedPenny D:\projects\MongoDBSP\StretchedPenny\StretchedPenny\StretchedPenny\Models\Items.cs 9
In Realm, what is the recommended way to create a unique key?