Skip to content

Instantly share code, notes, and snippets.

@akamud
Last active May 24, 2021 13:19
Show Gist options
  • Save akamud/582daf25165a9757416f0d4229da19a3 to your computer and use it in GitHub Desktop.
Save akamud/582daf25165a9757416f0d4229da19a3 to your computer and use it in GitHub Desktop.
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
}
}
}
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