📜  asp.net 现有数据库 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:01.906000             🧑  作者: Mango

代码示例1
# tested on Visual Studio 2019
# install these packages via View>Other windows>Package Manager Console
Install-Package Microsoft.EntityFrameworkCore.SqlServer
Install-Package Microsoft.EntityFrameworkCore.Design
Install-Package Microsoft.EntityFrameworkCore.Tools

# then scaffold the dbContext via your connection string
Scaffold-DbContext "Server="; Initial Catalog=; 
  User ID=; Password=; Microsoft.EntityFrameworkCore.SqlServer 
  -OutputDir Models -Context CoreDbContext - DataAnnotations