.Net Core Identity 擴展 User 資料欄位

Contents
IdentityUser Class (Microsoft.AspNetCore.Identity.EntityFrameworkCore) | Microsoft Docs裡面我們可以看到有基本欄位,但沒有其他資料,如: 性別、城市和國家等資訊。所以我們需要擴展 User 資料欄位方法。
操作流程
1. 新增 class 繼承 IdentityUser
|
|
2. AppDbContext 修改參數
|
|
3. Migration DB
|
|
4. View 擺上新增欄位
View
|
|
Controller
|
|
詳細可以看GIT。
GIT: 擴展 IdentityUser 欄位 · malagege/NetCoreAuthSample@b36f5e0