Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. var tasks = new Dictionary<Guid, Lazy<Task>>();
  2.  
  3. tasks.Add(Task1Guid, new Lazy<Task>(() => { whatever the 1st task is }));
  4. tasks.Add(Task2Guid, new Lazy<Task>(() => { whatever the 2nd task is }));
  5.  
  6.  
  7. void async RunTaskAsync(Guid guid)
  8. {
  9. await tasks[guid].Value;
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement