I am not sure if it would be possible to do that without checking it in the database or maintaining a reference of already generated registration codes in memory.
You can use GUID and append that to FirstName's first character and last name's first character. But it will be long, but unique.
string firstName = "John";
string lastName = "Cano";
string uniqueRegistrationCode = string.Format("{0}{1}-{2}", firstName[0], lastName[0], Guid.NewGuid());
and you would get back something like:
JC-3f507a3c-cd80-482d-b3be-c8002856926e
(this assuming that there is at least one character in first and last name)