-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
"FillFactor" was added several versions ago but it is incomplete/broken.
.HasFillFactor() is only settable on explicit/defined Indexes.
In SqlServer, FillFactor can be set on the PK without additional complexity to the Schema.
This is not available with the FillFactor implementation of EFC 8.
This is an incomplete implementation of the feature which is why I am filing as a bug and not as a feature request.
To advertise FillFactor is supported in EF, code like this:
builder.HasKey(x => x.Id).HasFillFactor(90);Should produce Sql Schema as:
CREATE TABLE [dbo].[MyTable](
[Id] [int] IDENTITY(1,1) NOT NULL
CONSTRAINT [PK_MyTable] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, FILLFACTOR = 90, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GOor at a minimum, provide a fluent option that ultimately executes the following sql as it will cover the PK:
ALTER TABLE MyTable REBUILD WITH (FILLFACTOR = 90);
GOEF Core version: 8
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 6.0
Operating system: Win10
IDE: Visual Studio 2022 17.4