更改视觉基本模型文件后,Visual Studio更新SQL表模式
假设我有一个文件订单
Imports System.Data.Entity
Imports DbContext
Public Class Order
Public Property id As Guid
Public Property storeNumber As Integer
End Class
Public Class OrderDBContext
Inherits DbContext
Public Property Orders() As DbSet(Of Order)
End Class
。
然后,我将其更改为:
...
Public Property storeNumber As Integer?
...
制作StoreNumber
字段nullable。
如何告诉Visual Studio根据新模型更新更新SQL Server表?
Let's say I have a file Orders.vb, with this content:
Imports System.Data.Entity
Imports DbContext
Public Class Order
Public Property id As Guid
Public Property storeNumber As Integer
End Class
Public Class OrderDBContext
Inherits DbContext
Public Property Orders() As DbSet(Of Order)
End Class
The table was automatically created in SQL Server.
Then I change it to this:
...
Public Property storeNumber As Integer?
...
making the storeNumber
field nullable.
How do I tell Visual Studio to update the SQL Server table based on the new model update?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论