I have a model that has a toMany relationship with another model. The UI binds directly to the toMany collection which is an IList and is also a LiveConnection or LiveBinding (whatever its called).
I would like to add a back link relationship between the models, but to do this the IList has to change to an IQueryable. I do a lot of collection manipulation from the UI to said IList so changing it to an IQueryable breaks everything.
Is there a way to get around this issue? I thought that made I could have both an IList and an IQueryable in the model and link them somehow so then the IList updates the IQueryable would also update. Any thoughts anyone?
public partial class TriviaGame : RealmObject, IHaveAnObjectId
{
[MapTo("_id")]
[PrimaryKey]
public ObjectId Id { get; set; } = ObjectId.GenerateNewId();
public IList<Section> Sections { get; }
// this is what it would need to change to but it breaks all the UI binding
// [Backlink(nameof(Section.OwnedGame))]
// public IQueryable<Section> Sections { get; }
}
public partial class Section : RealmObject, IHaveAnObjectId
{
[MapTo("_id")]
[PrimaryKey]
public ObjectId Id { get; set; } = ObjectId.GenerateNewId();
public TriviaGame OwnedGame { get; set; }
}