Guest User

Untitled

a guest
May 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. public void DoTheThing() {
  2. ...
  3. Task fireAndForget = SendAsync(emails);
  4. }
  5.  
  6. public async Task SendAsync(emails) {
  7. foreach (var email in emails) {
  8. var to = email.to;
  9. var body = email.body;
  10. await EmailSenderAsync(to,body);
  11. await Task.Delay(3000);
  12. }
  13. }
Add Comment
Please, Sign In to add comment