9. Further Explanation (補充說明) - wezmag/AspNetIdentityDbFirst GitHub Wiki

When creating AspNetUser instance in Register action in AccountController, remember assign an id to be able to register account successfully.

在AccountController的Register action,建立AspNetUser時,記得要給他一個Id,才能註冊成功。

DB Schema

In fact, I was going to use bigint for user's Id for this demo, but I didn't notice after the database was created. That's why it end up with nvarchar as Id. However, the concept is still the same.

其實,我第一次在做的時候,User的Id本來想用bigint+Identity作範例,但是因為建立資料庫時,沒有注意到我的Sql Script,所以才會變成用nvarchar,但是這並不影響我們在練習的效果。

After modifying edmx using XML Editor, the diagram looks a bit weird. You can fix it by modifying MyModel.edmx.diagram

再來就是用XML Editor修改過後的edmx,圖形呈現其實是有問題的,不過,這可以透過修改MyModel.edmx.diagram來改善

People might ask "When adding new tables or columns, do I need to modify edmx again?". I have been using this for a while, and did not encounter any problems.

有人可能會問,當新增資料表,或是新增欄位時,edmx會不會要重新修改,我這裡測試的結果是不需要的。