2. Creating Database (建立資料庫) - wezmag/AspNetIdentityDbFirst GitHub Wiki
Since this is all about database first approach, we need to create a database first.
The basic tables schema for ASP.Net Identity is as below:
既然是Database First,首先要先有資料庫。 使用過ASP.Net Identity的開發人員都知道,它的資料庫有一個基本的架構,如下:
First thing first, we need to create the same tables.
Some of you might ask do I need to use "AspNet" as the prefix for those tables?
The answer is no, but I recommended that use the same prefix for these 5 tables, and do NOT use it for all other tables in this database. You will know why later.
You can use the SQL script provided below to create tables.
所以我們第一步一樣要建立出相同的資料表,方便後續的流程進行。 可是有些人就會問「我一定要用AspNet作為資料表的Prefix嗎?」,其實是不用的,但是建議這五個資料表都使用相同的Prefix,也不要跟資料庫中其他的資料表一樣。(之後就會知道原因了)
為了方便大家練習,請自行複製SQL Script,建立資料庫
SQL Script: https://gist.github.com/wezmag/2fbdb1a8cf8f0d9ab7430673d64aac5a