简体   繁体   English

如何使用框架迁移创建行版本字段

[英]How to create rowversion field with using frame work migrations

How would I generate a rowversion field using entity framework migrations? 如何使用实体框架迁移生成Rowversion字段? Here is a sample of what I am trying to achieve. 这是我要达到的目标的一个示例。

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);
Version = c.Binary(nullable: false, fixedLength: true, timestamp: true, storeType: "rowversion"),

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用模型优先方法为乐观并发创建RowVersion列? - How to create RowVersion column for optimistic concurrency using model first approach? 如何使用代码首次迁移创建数据库? - How to create database using code first migrations? 如何让实体框架停止设置rowversion字段? - How do I get the entity framework to stop setting the rowversion field? 实体框架如何在不使用timestmp或rowversion的情况下检测并发冲突 - How will entity framework detect concurrency conflicts , without using timestmp or rowversion 使用 dotnet ef 迁移创建数据库时如何设置字符集? - How to set charset when using dotnet ef migrations to create a database? 实体框架:如何通过rowversion字段为每个类继承启用一个表? - Entity Framework: How can I enable a one table per class inheritance with a rowversion field? 带有时间戳/行版本字段的实体对象属性? - Entity object property with a timestamp/rowversion field? 使用SQL Server和Entity Framework时,如何在C#类中定义RowVersion - How do I define RowVersion in a C# class when using SQL Server and Entity Framework DefaultValue for Entity Framework迁移如何工作? - How does the DefaultValue for Entity Framework Migrations work? 使用Entity Framework 6获取RowVersion的新值 - Getting a the new value of RowVersion using Entity Framework 6
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM