In my Test Engine, I want to impose security by which users won't be able to access the registration page directly, only the people I sent invite will get the authority of registering themselves. For that, I created an invite table in Sql server which has an inviteCode column with uniquieidentifier datatype. To generate 1000 invite codes, I created a stored procedure in sql server itself. In my mvc model, I have a class which fetch these inviteCodes to the Controller. These trick works but I don't think it's the best approach. All top sites have referal link system to invite user , I have no idea how to create referal links ?
Most of the programming problems can't be solved because you don't know what the exact problem is.
Defining your problem correctly leads you to the right solution.