我无法使用context.
Database.ExecutesqlCommand()通过DbContext发送sql语句.
我试图执行
CREATE TABLE Phones([Id] [uniqueidentifier] NOT NULL PRIMARY KEY,[Number] [int],[PhoneTypeId] [int]) GO ALTER TABLE [dbo].[Phones] ADD CONSTRAINT [DF_Phones_Id] DEFAULT (newid()) FOR [Id] GO
错误字符串失败
Incorrect Syntax near the keyword 'ALTER'. Incorrect Syntax near 'GO'.
但是在SSMS中运行该确切的语句运行没有错误?有关通过DbContext的默认约束需要解决的任何问题.我看到使用约束并且IsDbGenerated设置为true的人的问题.我不知道这将如何适用于这里.