Hi,大家好,我是编程小6,很荣幸遇见你,我把这些年在开发过程中遇到的问题或想法写出来,今天说一说mysql 建表 identity_identity数据库表格创建方法[通俗易懂],希望能够帮助你!!!。
1.写一个继承于identityDbContext的DbContext 并创建构造方法。
2.注册identity和dbcontext服务
3.迁移 Add-Migration AddProductReviews
4.在连接字符串中写入要添加的数据库
5.更新数据库 Update-Database
6.生成数据库实体类
Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
同时
1.写一个继承于DbContext的DbContext 并创建构造方法。
2.注册identity和dbcontext服务 重新生成
6.生成数据库实体类
Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
3.迁移 Add-Migration AddMigration
4.在连接字符串中写入要添加的数据库
5.更新数据库 Update-Database
oil覆盖
生成数据库实体类
Scaffold-DbContext "Server=(localdb)\mssqllocaldb;Database=Blogging;Trusted_Connection=True;" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models
一个继承于identityDbContext的DbContext 并创建构造方法。
2.注册identity和dbcontext服务 重新生成
3.迁移 Add-Migration AddMigration
4.在连接字符串中写入要添加的数据库
覆盖报错 修改Migration 中 up方法 删除不需要新增的表
5.更新数据库 Update-Database