我已创建像下面如何在执行异步方法后调用成功的回调函数?
System.Threading.Tasks.Task.Factory.StartNew(
() => AddAttachment(document, docId, user)).ContinueWith(
task => BackUpQueuesMail(task.Exception, information, list),
TaskContinuationOptions.OnlyOnFaulted);
我需要成功地执行AddAttachment()方法处理后的回调函数异步方法。我怎样才能做到这一点?
您不需要延迟启动。只需使用StartNew。 – usr
感谢@usr,我已经更新了代码示例。 – avivr