C# SchemaBuilder和Id的起始值

C# SchemaBuilder和Id的起始值,c#,sql,asp.net-mvc,migration,orchardcms,C#,Sql,Asp.net Mvc,Migration,Orchardcms,我正在为Orchard CMS编写一个模块,我需要将Id的起始值设置为15。 我如何通过代码来实现它 在Migrations.cs中: SchemaBuilder.CreateTable("NewRecord", table => table .ContentPartRecord() .Column<int>("Id", c => c.PrimaryKey().Identity()) schemabilde

我正在为Orchard CMS编写一个模块,我需要将Id的起始值设置为15。 我如何通过代码来实现它

在Migrations.cs中:

            SchemaBuilder.CreateTable("NewRecord", table => table
        .ContentPartRecord()
            .Column<int>("Id", c => c.PrimaryKey().Identity())
schemabilder.CreateTable(“NewRecord”,table=>table
.ContentPartRecord()
.Column(“Id”,c=>c.PrimaryKey().Identity())

它使用主键创建列Id。我应该添加什么来设置起始值?谢谢!

无法从数据迁移API定义此值。

谢谢大家!解决此问题的方法是在表中删除主键并更改列Id?这是自动创建的。我使用SchemaBuilder.ExecuteSQL完成了此操作(string)方法。

我不确定这一点,所以没有回答:我知道没有直接的方法,但可能会设置默认值(.WithDefault())如果Orchard不支持,您可以编写自定义DB调用,自己发布DDL,修改种子值。虽然非常粗糙,但除非没有其他方法,否则不建议这样做。