dotnet-daily-tips

038 - Random.Shared

Do you know that from .NET 6 you don’t need to create Random class to be able to get pseudo-random values? There’s a static, thread-safe instance that can be used to obtain those values. But the novelty doesn’t end here. From .NET 8 we do have new methods available too.

We have the following two new methods under our belt:

Docs: