Last active
May 24, 2021 13:19
-
-
Save akamud/582daf25165a9757416f0d4229da19a3 to your computer and use it in GitHub Desktop.
.NET 6 Random.Shared - https://github.com/dotnet/runtime/pull/50297
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Projeto | |
{ | |
public class MinhaClasse | |
{ | |
private Random _random; | |
public MinhaClasse() | |
{ | |
_random = new Random(); | |
} | |
public void MetodoRandomico() | |
{ | |
var valor = _random.Next(); | |
// Faz algo com o valor | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Projeto | |
{ | |
public class MinhaClasse | |
{ | |
public void MetodoRandomico() | |
{ | |
var valor = Random.Shared.Next(); | |
// Faz algo com o valor | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment