Join the DZone community and get the full member experience.
Join For Free
Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud, brought to you in partnership with IBM.
Here is an interesting issue, you need to implement a Share Source
but to do the sharing you need it to be an async call. So what do you
do? You can add the async & await modifiers but it won’t work
correctly. The solution is to use the deferral which is given to you in
the arguments of the event and when you are done you call the Complete method on it to indicate that you are done with all the async goodness:
async void App_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)
var deferral = args.Request.GetDeferral();
// async code with await keyword here
For more posts in this series, see the series index.
The Mobile Zone is brought to you in partnership with Strongloop and IBM. Visually compose APIs with easy-to-use tooling. Learn how IBM API Connect provides near-universal access to data and services both on-premises and in the cloud.
Published at DZone with permission of
Robert Maclean, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.