Migratordotnet:如何用VB.net编写迁移类?
我在 Google 上获得了所有 C# 实现,因此我将其转换为 VB.Net,但我无法转换出现错误的 1 行。
我的班级:
Imports Migrator.Framework
[Migration(1)] ' Gives ERROR Here.. How to write this in VB.net ?
Public Class mig_001
Inherits Migration
Public Overrides Sub Up()
Database.AddTable("Planets",
New Column("Id", DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity),
New Column("Name", DbType.String, 100, ColumnProperty.NotNull),
New Column("Diameter", DbType.Double),
New Column("Mass", DbType.Double),
New Column("SupportsLife", DbType.Boolean, False)
)
End Sub
Public Overrides Sub Down()
Database.RemoveTable("Planets")
End Sub
End Class
再次:
[Migration(1)] => How to write this in VB.net and what does it means in VB.net ?
我在一篇文章中读到,它对于迁移版本是强制性的,否则 Migratordotnet 将错过迁移。
那么.. 怎么办呢?
I got all C# implementations on Google, so I converted it to VB.Net, but I am not able to convert 1 line where it gives error.
My Class :
Imports Migrator.Framework
[Migration(1)] ' Gives ERROR Here.. How to write this in VB.net ?
Public Class mig_001
Inherits Migration
Public Overrides Sub Up()
Database.AddTable("Planets",
New Column("Id", DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity),
New Column("Name", DbType.String, 100, ColumnProperty.NotNull),
New Column("Diameter", DbType.Double),
New Column("Mass", DbType.Double),
New Column("SupportsLife", DbType.Boolean, False)
)
End Sub
Public Overrides Sub Down()
Database.RemoveTable("Planets")
End Sub
End Class
Once again :
[Migration(1)] => How to write this in VB.net and what does it means in VB.net ?
I read in an article that its mandatory for version of Migration, otherwise Migratordotnet will miss the migration.
So.. How to do it ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像这样:
这个
<…>
功能属于以下类,在 .NET 中称为属性。Like this:
This
<…>
feature, belonging to the following class, is called an attribute in .NET.