I'm using Entity Framework 7 (.NET Core 1) RC1. I'd like to create some indexes in a Migration. That part is easy enough, but I can't find any examples of how to specify the fill factor for the indexes.
The Context looks something like this:
modelBuilder.Entity<SomeObject>( entity =>
{
entity.HasIndex( e => e.SomeProperty ).HasName(" IX_SomeObject_SomeProperty" );
}
And the Migration looks something like this:
migrationBuilder.CreateIndex(
name: "IX_SomeObject_SomeProperty",
schema: "dbo",
table: "SomeObject",
column: "SomeProperty" );
Is this just not supported by Fluent? Will I have to create the index manually in the Migration?
2条答案
按热度按时间kmb7vmvb1#
EF Core 5.0即将支持该功能。
参考:https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-5.0/whatsnew#specify-sql-server-index-fill-factor
s71maibg2#
EF Core RC1不支持填充因子。您可以使用
migrationBuilder.Sql
手动编写create index语句。