realm / realm-dotnet

Realm is a mobile database: a replacement for SQLite & ORMs
https://realm.io
Apache License 2.0
1.25k stars 165 forks source link

Can't create references to the User Model #1377

Closed andrelmchaves closed 7 years ago

andrelmchaves commented 7 years ago

Hello!

How can I add a reference to the User model. I need to store a user score in a test, and a supervisor has to see that information and aprove or reprove the guy.

Severity Code Description Project File Line Suppression State Error Fody/RealmWeaver: Test.user is a 'Realms.Sync.User' which is not yet supported. AND c:\users\patrícia\documents\visual studio 2015\Projects\AND\AND\Models\Test.cs 12

nirinchev commented 7 years ago

Realm users are stored in a separate file, so referencing them in your models is not supported. Additionally, it is likely that you'll want to store some metadata for the user, e.g. name, phone number, so a workaround would be to create your own User class with all the required metadata that has a string RealmUserId property, which is populated with User.Identity.

andrelmchaves commented 7 years ago

Thanks! It worked.