I have been trying to follow some WCF Data Services examples and have the following code:
private void OnSaveCompleted(IAsyncResult result)
{
Disp
Answer by Jon Skeet is very good but there are other possibilities. I prefer "begin invoke new action" which is easy to read and to remember for me.
private void OnSaveCompleted(IAsyncResult result)
{
Dispatcher.BeginInvoke(new Action(() =>
{
context.EndSaveChanges(result);
}));
}
or
private void OnSaveCompleted(IAsyncResult result)
{
Dispatcher.BeginInvoke(new Action(delegate
{
context.EndSaveChanges(result);
}));
}
or
private void OnSaveCompleted(IAsyncResult result)
{
Dispatcher.BeginInvoke(new Action(() => context.EndSaveChanges(result)));
}