Closed kfrancis closed 6 years ago
The reason the async method "spins" is that you need to await the task before proceeding. Depending on context, this will require you to also set .ConfigureAwait(false)
var sendingTask = SendMessageAsync(templateMessage);
sendingTask.ConfigureAwait(false);//optional depending on use case
sendingTask.Wait();
//get the result of the call, remember, this can throw.
sendingtask.Result;
I have legacy sync code and I'm trying to update to use a template, but the SendMessage doesn't allow TemplatePostmarkMessage types and SendMessageAsync just spins (specifically I'm using
SendMessageAsync(templateMessage).Result
).