IList embedded Object for a RealmObject returning with error

I’m trying to create a RealmObject entry with an IList Embedded Object as a nested property. I can’t make it work. The google answers I’ve found shows a single index added from a list, not the whole list.

how can i make this work ?

the code:

the error :
Cannot implicitly convert type ‘Heals’ to ‘System.Collections.Generic.IList’. An explicit conversion exists (are you missing a cast?)

Hi @Joshua_Baldos

You are trying to assign a single Heals value to a IList<Heals>, that is the reason why you are getting that error.
You probably wanted to do something like HealItems.Add(healing). You don’t need to (and can’t) assign the IList itself, but you can add and remove elements from it.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.