我正在使用Visual Studio中更新的Nuget软件包管理器控制台从我从命名Sail连接的数据库中搭建模型。当我在“程序包管理器”控制台中输入连接字符串
PM> Data Source=localhost;Initial Catalog=Sail;Integrated Security=True
我收到以下错误:
At line:1 char:12
+ Data Source=localhost;Initial Catalog=Sail;Integrated Security=True; ...
The Data section is missing its statement block.
答案 0 :(得分:0)
找到我的答案:下面的块从连接的“ Sail” SQL数据库成功生成了模型。
Scaffold-DbContext –Connection "Server(localdb)\mssqllocaldb;Database=Sail;Trusted_Connection=True;"
(localdb)\mssqllocaldb;Database=Sail;Trusted_Connection=True;"
-Provider "Microsoft.EntityFrameworkCore.SqlServer" -OutputDir "Models" –Context "Sail" –Verbose -Force