You can use something like
int codeLength = 3;
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
var random = new Random();
string result = new string(
Enumerable.Repeat(chars, codeLength)
.Select(s => s[random.Next(s.Length)])
.ToArray());
result = result.Insert(2, "-");