Differences between revisions 2 and 3
Revision 2 as of 2015-06-25 21:13:32
Size: 841
Editor: scot
Comment:
Revision 3 as of 2015-06-25 21:13:57
Size: 853
Editor: scot
Comment:
Deletions are marked like this. Additions are marked like this.
Line 13: Line 13:
 1. In IdentityModels.cs, public class ApplicationUser { ... [Add a property] ...} // This adds the property to the user profile.  1. In {{{IdentityModels.cs}}}, public class {{{ApplicationUser { ... [Add a property] ...}}}} // This adds the property to the user profile.

Changing the Identity Database for MVC 5 / ASP.NET / .Net 4.5

Re-targeting your authentication to a different database

All you really need to do is update the connectionString part of the

<connectionStrings><add name="..." connectionString="CHANGE THIS HERE" .../>

Adding values to the Identity Model

  1. In IdentityModels.cs, public class ApplicationUser { ... [Add a property] ...} // This adds the property to the user profile.

  2. If this is code first in the package manager:
    1. # Enable-migration
    2. # Add-migration [new-name]
    3. # Update-database
  3. Change AccountViewModels.cs, public class RegisterViewModel { ... [Add a property] ...}

  4. Update Register.cshtml [Add code for new property]
  5. AccountController.cs Add: {{{user.[New Property] = model.[New Property]

ProgrammingLinks/ChangeIdentityDatabase (last edited 2015-06-25 21:14:50 by scot)