我只需要爲正數(0 -...)添加約束並將數字限制爲(...- 1)。實體框架代碼第一次爲正數添加約束
CreateTable(
"dbo.Drinks",
c => new
{
Id = c.Int(nullable: false, identity: true),
Name = c.String(),
ImageUrl = c.String(),
Price = c.Int(nullable: false),
Count = c.Int(nullable: false)
})
.PrimaryKey(t => t.Id);
//.Constraint ???
類似MS SQL中的'unsigned'。 謝謝。