String.Create
When it comes to performance in .net then String.Create is a friend. String.Create creates a string very quickly and with minimal memory overhead.
Especially when it comes to performance, String is always a small obstacle. This also has to do with how strings are defined in .NET.
As a reminder:
Strings are reference types and their data is stored on the managed heap.
Strings are inherently immutable, which means that their data cannot be changed once they have been created.
Let's take a look at this using an example
normal
public string GenerateShortCode_Classic()
{
var random = new Random();
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
return new string(Enumerable.Repeat(chars, 6)
.Select(s => s[random.Next(s.Length)]).ToArray());
}