vicpinm / Kotlin-Realm-Extensions

Kotlin extensions to simplify Realm API.
Apache License 2.0
535 stars 53 forks source link

Return the RealmModel object after save() ? #67

Closed lpbas closed 5 years ago

lpbas commented 5 years ago

Hello. I would like to thank you for these helpful extensions!

Is it possible to get the saved RealmModel back from the Realm, after calling save(), so we can continue using it?

I would like to do the following:

val user = User("John").save() //do something else with the user object

Is this possible? Thank you!

lpbas commented 5 years ago

I just saw the .createOrUpdateManaged(realm) method which does exactly what I was looking for. Thank you very much!