如何使用框架工作迁移创建rowversion字段

时间:2014-06-17 06:22:43

标签: entity-framework ef-migrations rowversion

如何使用实体框架迁移生成rowversion字段? 以下是我想要实现的一个示例。

CreateTable(
                companiesTable,
                companies => new
                {
                    Id = companies.Int(nullable: false, identity: true),
                    RowVersion = companies.????,
                    Name = companies.String(nullable: false, maxLength: 256),
                    Slug = companies.String(nullable: false, maxLength: 256)
                })
                .PrimaryKey(x => x.Id)
                .Index(x => x.Slug, unique: true);

1 个答案:

答案 0 :(得分:0)

Version = c.Binary(nullable: false, fixedLength: true, timestamp: true, storeType: "rowversion"),