0

I am trying to play around with ASP Identity and I customized IdentityUser by adding extra fields on it. After ASP Identity tables were created, how do you update (add/remove) more custom fields to existing ASPNetUsers without recreating dropping and recreating tables? Because there are data on it.

I am curious. Thank you

user3187337
  • 55
  • 1
  • 6
  • What's fairly common is to have a separate user table with application-specific data that has a foreign key link back to the ASP identity table. Often that's because the user data is pre-existing but it's also useful to separate your user data management from the ASP identity management. – christutty Mar 21 '16 at 06:44
  • @christutty - yeah that's one way of doing it - so that means you have to pull on two tables (asp identity user and the one table linked to identity user table). Is it good practice having 2 separate tables even on initial setup? – user3187337 Mar 21 '16 at 06:55
  • Ii has some hassles, mainly that it's difficult to make the user object available to the controller generically (i.e., without explicitly coding a lookup into every method) and yes, it's a one to one relationship so isn't the greatest solution. – christutty Mar 21 '16 at 07:51
  • Possible duplicate of [How to extend available properties of User.Identity](http://stackoverflow.com/questions/28335353/how-to-extend-available-properties-of-user-identity) – christutty Mar 21 '16 at 07:51
  • Migrations won't drop and recreate your tables just by adding or removing properties. The changes will appear in your next migration and the other fields won't be affected. – Steve Greene Mar 21 '16 at 17:07

0 Answers0