Skip to content

Commit

Permalink
use shared instance of random
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-hillier committed Dec 8, 2023
1 parent 19b83cc commit f64256b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions content/en/docs/instrumentation/net/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ string HandleRollDice([FromServices]ILogger<Program> logger, string? player)

int RollDice()
{
var rng = new Random();
return rng.Next(1, 6);
return Random.Shared.Next(1, 7);
}

app.MapGet("/rolldice/{player?}", HandleRollDice);
Expand Down

0 comments on commit f64256b

Please sign in to comment.