asp.net mvc - MVC Membership change UserId Value -


using mvc when registering new user record gets created in webpages_membership , userprofile

the userid default gets created sequential number 1, 2, 3...

my model

public class userprofile     {         [key]         [databasegeneratedattribute(databasegeneratedoption.identity)]         public int userid { get; set; }     } 

when go edit record in url shows /profile/1

i want change id's value random e.g. profile/f8934hre987f8987f9f8 security reasons.

same thing want generate random number when details gets viewed members instead /details/1 want /details/783787483743874873 viewmodel displaying details contains id field primary key gets generated sequentially.

i read using [guid] not great performance.

advice how change without affecting performance? suggestions. thank you.

edit

have similar groupon site, when user attempts edit his/her profile instead of showing /edit/1 have like:

enter image description here

so user doesnt know how many records in database or record number user is.

i not 100% sure mean random. assuming mean encryption. please take @ this msdn link details on encryption.

after ,you can have action method /detail/{encrypteduserid}

then can have action method below

public class detail(string id) {     var decrypteduserid = getdecryptedid(id);      // getdecryptedid gives decrypted information.      // can implement based on msdn link     // can use decrypteduserid run queries on database. } 

this way can achieve goals without making schema changes. seems minimum possible friction approach.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -