public static Task ContinueWithContext(this Task task, Action <Task> continuation) { Contract.Requires <ArgumentNullException>(task != null); Contract.Requires <ArgumentNullException>(continuation != null); return(task.ContinueWithContext(new Func <Task, object>(t => { continuation(t); return null; }))); }