jonwagner / Insight.Database

Fast, lightweight .NET micro-ORM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Load ObserverableCollection from RowSet

richbryant opened this issue · comments

When using [Rowset] annotations on an object, fill Child records into an ObservableCollection

Currently, if you try this, you get "Operation may destabilize the runtime" and it's lengthy workaround time.

If I have this piece of code on an AutoInterface -

[Sql("Stages_GetByCycle")]
        [Recordset(1, typeof(Instruction), Id = nameof(Instruction.Id), GroupBy = nameof(Instruction.StageId), Into = nameof(Stage.Instructions), IsChild = true)]
        IEnumerable<Stage> GetByCycle(long id);

and Stage.Instructions is a List or IEnumerable, it's fine. No problem. But really, I'd like for it to be an ObservableCollection so that I can eliminate largely useless ViewModels from my application.

Is there any way to achieve this?

Absolutely! Tell me the steps, I'll have a crack at it.

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.