NeverBounce / NeverBounceApi-DotNet

MIT License
4 stars 7 forks source link

Update .NET SDK examples to use `await` instead of `.Result` #8

Closed mmollick closed 5 years ago

mmollick commented 5 years ago

Our examples currently look like this:

sdk.Single.Check(model).Result

However, this method of dealing with Async method in .NET is prone to deadlocks when used in UI threads. We frequently have users reaching out wondering why they're application is hanging and they never receive a response. The solution is to use the following instead:

await sdk.Single.Check(model)