Open A9G-Data-Droid opened 1 year ago
My current workaround is having 2 objects with identical properties, one for loading from CSV and one for saving to the database. This is not ideal. I would rather have one object.
When looping through the properties and setting them I learned that I need to ignore properties added by Realm. This might be a clue except if we are just looking for properties that match the data, you wouldn't stumble into these other properties. They only exist if you are looping on the destination object properties.
Describe the bug I have a custom object that I'm populating a list of from a CSV file using
GetRecords<MyClass>
. It's been working fine. Now I want to store that object in a Realm database, so I changed my object to implement: IRealmObject
. Now I am receiving the error:To Reproduce Take any custom object that works with CSV reader and change the signature to implement
: IRealmObject
. Now it bork.Expected behavior I would expect it to load the properties into the object just like it used to.
Screenshots![image](https://user-images.githubusercontent.com/26984068/235751567-f700912d-f6b9-4601-85fe-7d00aed0e801.png)
Additional context The way RealmObjects work is Realm uses FodyWeaver to add magic dust to your object via dynamic code generation at compile time. You get a file named like
MyClass_generated.cs
which overridesGetValue
,SetValue
, adds somePropertyChangedEventHandler
andSetManagedAccessor
stuff. Any of those could be throwing it off. I don't know enough about CsvReader or Realms to be able to troubleshoot this.Stack Trace