Microsoft.AspNet.Identity.Core
Microsoft.AspNet.Identity.EntityFramework
AccountController.cs
new UserManager<ApplicationUser>(…)
IdentityModel.cs
class ApplicationUser and ApplicationDbContext
1. Add customize field, FavoriteBook, into IdentityUser table
2. Add customize table, Movie, into IdentityDbContext
3. Don’t forget to add textbox of customize field on related Views
4. Don’t forget to do DB Migration to apply schema changes in database, otherwise we will see following error
Configuration.cs in Migration folder
5. new ApplicationUser{}
6. new PasswordHasher()
7. Or the other way to create default user in Seed method
8. Run command, update-database, in Package Manager Console
9. If want to add default Role to defaut user
沒有留言:
張貼留言