Upcoming .NET User Forum Zurich / 6th July 2021

01/07/2021

Agenda

The talk will have the following topics:

  • Asynchronous Programming vs Parallel Programming
  • Deadlock and ConfigureAwait
  • State-Machine (very briefly and over-simplified)
  • Pitfalls & General Tips
  • ValueTask

And here a small teaser:

What do you think is wrong with the following code snippet?:

var ids = new List<int>();
// ...
ids.ForEach(async id => await _myRepo.UpdateAsync(ids));

We could argue that everything will run smoothly, but the problem lies in the defintion of List<T>.ForEach itself:

public void ForEach (Action<T> action);

See MSDN List.ForEach.

As ForEach accepts only Action and Action is not awaitable you can run into big trouble. This would be the same behaviour as public async void.

How can I join 🤷

As this is an online only event, feel free to join: https://www.meetup.com/dotnet-zurich/events/278916769/

All details you will find on the linked page above.

0
Buy Me a Coffee at ko-fi.com
An error has occurred. This application may no longer respond until reloaded. Reload x