TXDataWebDataset add a LoadAndAwait method

It would be useful to have a method added to the TXDataWebDataset that enabled the loading of a dataset and awaited until after the dataset was opened

Await(MyDataset.LoadAndAwait);

another useful method would be ApplyUpdatesAndAwait.

These would enable more readable code especially when there are a series of datatsets that need processing but are reliant on a previous dataset, rather than have to keep jumping between AfterOpen and AfterApplyUpdates.

The more I do with my latest project, the more I realise what a a gift this would be in simplifying the code

I think with ApplyUpdatesAndAwait that the AfterApplyUpdates would need to be called before the Await was returned. This could make it tricky?.

We can't tell if it's tricky until we get our hands on it. I believe it's not.

1 Like

Implemented as LoadAsync and ApplyUpdatesAsync. For ApplyUpdates, yes, AfterApplyUpdates is executed before await is returned, but nevertheless, ApplyUpdatesAsync returns the TResolveResults record as the function result.

Will be available in XData version 5.20.

2 Likes

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