Differences between revisions 3 and 4
Revision 3 as of 2015-06-25 21:13:57
Size: 853
Editor: scot
Comment:
Revision 4 as of 2015-06-25 21:14:40
Size: 877
Editor: scot
Comment:
Deletions are marked like this. Additions are marked like this.
Line 18: Line 18:
 1. Change AccountViewModels.cs, public class RegisterViewModel { ... [Add a property] ...}
 1. Update Register.cshtml [Add code for new property]
 1. AccountController.cs Add: {{{user.[New Property] = model.[New Property]
 1. Change {{{AccountViewModels.cs}}}, {{{public class RegisterViewModel { ... [Add a property] ...} }}}
 1. Update {{{Register.cshtml}}} [Add code for new property]
 1. {{{AccountController.cs}}} Add: {{{user.[New Property] = model.[New Property]

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)