当前位置:网站首页>通过EF Core框架根据SQL Server数据库表生成实体类
通过EF Core框架根据SQL Server数据库表生成实体类
2022-06-30 11:56:00 【新鑫S】
导入三个包,运行一个脚手架命令即可。
NuGet包
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.Tools
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Design
NuGet包管理器控制台运行
一、打开NuGet包管理器控制台,依次运行以下四个命令:
Install-Package Microsoft.EntityFrameworkCore.SqlServer
Install-Package Microsoft.EntityFrameworkCore.Tools
Install-Package Microsoft.EntityFrameworkCore.SqlServer.Design
二、前面部分是数据库连接字符串,Microsoft.EntityFrameworkCore.SqlServer
是数据库类型,-OutputDir Models
是保存到哪个文件夹。
caffold-DbContext 'Data Source=服务器名称;Initial Catalog=数据库;User ID=登录名;Password=密码;MultipleActiveResultSets=True;Connection Timeout=120' Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models -Context DbContext
边栏推荐
猜你喜欢
随机推荐
STM32 移植 RT-Thread 标准版的 FinSH 组件
TypeScript ReadonlyArray(只读数组类型) 详细介绍
Typescript readonlyarray (read only array type) details
R语言ggplot2可视化:使用ggplot2可视化散点图、使用scale_x_log10函数配置X轴的数值范围为对数坐标
R language ggplot2 visual Facet: gganimate package is based on Transition_ The time function creates a dynamic scatter graph animation (GIF) and uses the labs function to add a dynamic time title to t
8253 counter introduction
Another miserable day by kotlin grammar
并行接口8255A
Go zero micro Service Practice Series (VIII. How to handle tens of thousands of order requests per second)
led背光板的作用是什麼呢?
Swagger2自动生成APi文档
"War" caused by a bottle of water
ClipboardJS——开发学习总结1
goto语句跳转未初始化变量:C2362
R语言ggplot2可视化:使用ggplot2可视化散点图、aes函数中的colour参数指定不同分组的数据点使用不同的颜色显示
1254. 统计封闭岛屿的数目
After the node is installed in the NVM, the display is not internal or external when the NPM instruction is used
Quel est le rôle du rétroéclairage LED?
Review the writing software with characteristics
How can c write an SQL parser