'Does Entity Framework 6 Have Ability to Add Included Columns When Adding an Index Out of the Box?
I have implemented as suggested here to handle included columns on indexes using EF v3.1.5: https://mindbyte.nl/2017/12/26/Create-indexes-with-included-columns-with-Entity-Framework-Core-using-code-first.html
And you get this:
CREATE NONCLUSTERED INDEX [IX_Blah] ON [Blah]
(
[ColumnName] ASC
)
INCLUDE([IncludedColumnName1],[IncludedColumnName2]) WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
GO
INCLUDE([IncludedColumnName1],[IncludedColumnName2]) - is what you get with the annotation extension.
Does EF v6 have this out of the box? I do not seem to be able to locate any info on this.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|