realm / realm-browser-osx

DEPRECATED - Realm Browser for Mac OS X has been replaced by realm-studio which is cross platform.
https://realm.io
502 stars 54 forks source link

C# Generator creates lists for to-one relationships #308

Closed kristiandupont closed 7 years ago

kristiandupont commented 7 years ago

Generating the demo database and exporting C# definitions from it creates this:

public class RealmTestClass2 : RealmObject
{
    public long integerValue { get; set; }

    public bool boolValue { get; set; }

    public IList<RealmTestClass1> objectReference { get; }
}

The last property should be

    public RealmTestClass1 objectReference { get; set; }
jpsim commented 7 years ago

A quick look at the implementation seems to show this isn't possible 🤔

https://github.com/realm/realm-browser-osx/blob/v2.1.7/RealmBrowser/Support/RLMModelExporter.m#L610-L682

kristiandupont commented 7 years ago

To me it looks like a missing break statement here https://github.com/realm/realm-browser-osx/blob/v2.1.7/RealmBrowser/Support/RLMModelExporter.m#L668

jpsim commented 7 years ago

You're right!